POV-Ray : Newsgroups : povray.bugreports : transmit does not work with image maps : Re: transmit does not work with image maps Server Time
23 Jun 2024 07:45:33 EDT (-0400)
  Re: transmit does not work with image maps  
From: Kenneth
Date: 22 Apr 2024 12:15:00
Message: <web.662688b7e419c9f791c33a706e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> But in the v3.8 beta releases, something changed--  transmit all  is
> completely *ignored*, when used with typical 24-bit images. However, it DOES
> work correctly if those images are re-saved as 32-bit .png. I currently use
> the free paint.net app to do this-- it creates a 'dummy' [white] alpha
> channel, which is apparently needed now...

[Bald Eagle wrote:]
> I wanted to re-install that, but apparently they don't support a Win 7
> version anymore and I can't find an install package for it.  :(

I just discovered another way to get this 24-bit-to-32-bit image conversion, no
external app required. It can be done *within* POV-ray, by *re-rendering* the
image there as a 1:1 reproduction .png file and using OutPut_Alpha=on in
your .ini file (or +ua on the command line).  This produces a 32-bit image with
a dummy white alpha channel, just like paint.net.  Then  'transmit all'  can
work correctly with it. I have included a small image-copying scene file to do
this, for your enjoyment ;-)

Surprisingly, this new image also works correctly in v3.7.0  re:  transmit all
-- which has a problem with typical 32-bit alpha-channel images. I think this is
because the dummy alpha-channel *is* pure white (meaning fully 'opaque', no
transparency.) Whereas, the translucent/transparent areas in usual
alpha-channels are gray-to-black, with black representing full transparency.
It's *those* areas that cause the odd 'transmit all' color-reversal problem in
v3.7 (IF there are image colors in those areas.)

(BTW, the following bit of info in the POV-ray documentation at '3.6.2.6.4 Using
the Alpha Channel' can be ignored for this 1:1 re-render):
"Note: In version 3.7 alpha handling for image file output has changed.
Effectively, the background now requires a filter or transmit value in order for
alpha transparency to work properly."
-------------

#version 3.8; // 3.7 also works for this
global_settings{assumed_gamma 1.0}

//#declare IMAGE_DIMEN = <1152,921>; // pixel size of the original image to be
// copied. For perfect 1:1 final image size, enter these values onto
// the command line-- like +w1152 +h921 -- which overrides any .ini file
// resolutions.

// Or, you could use the max_extent(...) keyword to automatically get the
// dimensions of the image...
#declare IMG = pigment{image_map{jpeg "my image.jpg" gamma 2.2}} // must be
// #declared first. Do not use 'interpolate' for 1:1 reproduction. 'Once' is
// not necessary either. Gamma setting is optional.

#declare IMAGE_DIMEN = max_extent(IMG);

camera {
  orthographic // perspective or orthographic, same result
  location  <.5*(IMAGE_DIMEN.x/IMAGE_DIMEN.y), .5, -1> // u and v also work
  look_at   <.5*(IMAGE_DIMEN.x/IMAGE_DIMEN.y), .5,  0>
  right     x*image_width/image_height
  //angle 67 // Leave this out for 1:1 render! The default angle is not 67.
}

// the original image, on a box to copy it
box{0,<1,1,0> // zero-thickness is OK
texture{
    pigment{IMG}
    finish{ambient 1 emission 0 diffuse 0}
       }
    scale <IMAGE_DIMEN.x,IMAGE_DIMEN.y,1>/IMAGE_DIMEN.y
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.