Difference between revisions of "Reference Talk:Image Map"

From POV-Wiki
Jump to navigation Jump to search
(Created page with "==Using the Alpha Channel== <p>Another way to specify non-filtered transmit transparency in an image map is by using the<em> alpha channel</em>. POV-Ray will automatically use...")
 
m (grammar)
 
Line 11: Line 11:
 
<li> OpenEXR will use <em>associated</em> (ala <em>premultiplied</em>) alpha as per specifications.</li>
 
<li> OpenEXR will use <em>associated</em> (ala <em>premultiplied</em>) alpha as per specifications.</li>
 
<li> {{New}} as of version 3.7.1, TIFF will use straight or associated alpha as per the file header (3.7.0 expected associated alpha).</li>
 
<li> {{New}} as of version 3.7.1, TIFF will use straight or associated alpha as per the file header (3.7.0 expected associated alpha).</li>
<li> TGA and BMP 32-bit RGBA will use straight alpha, retaining file input compatibility for now, until a final decision has been made on these formats.</li>
+
<li> TGA and BMP 32-bit RGBA will use straight alpha, retaining file input compatibility for now, until a final decision is made on these formats.</li>
 
</ul>
 
</ul>
  

Latest revision as of 00:47, 24 July 2018

Using the Alpha Channel

Another way to specify non-filtered transmit transparency in an image map is by using the alpha channel. POV-Ray will automatically use the alpha channel for transmittance when one is stored in the image. PNG file format allows you to store a different transparency for each color index in the PNG file, if desired. If your paint programs support this feature of PNG you can do the transparency editing within your paint program rather than specifying transmit values for each color in the POV file. Since some image formats can also store full alpha channel (transparency) information you can generate image maps that have transparency which is not dependent on the color of a pixel but rather its location in the image.

Although POV uses transmit 0.0 to specify no transparency and 1.0 to specify full transparency, the alpha data ranges from 0 to 255 in the opposite direction. Alpha data 0 means the same as transmit 1.0 and alpha data 255 produces transmit 0.0.

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.

Previous versions of POV-Ray always expected straight (aka non-premultiplied) alpha for file input, this has been changed in 3.7 on a per-file-format basis as follows:

  • PNG will use straight alpha as per specification.
  • OpenEXR will use associated (ala premultiplied) alpha as per specifications.
  • New as of version 3.7.1, TIFF will use straight or associated alpha as per the file header (3.7.0 expected associated alpha).
  • TGA and BMP 32-bit RGBA will use straight alpha, retaining file input compatibility for now, until a final decision is made on these formats.

Additionally the premultiplied parameter may be used to specify the input image alpha handling. This boolean parameter specifies whether the file is stored in premultiplied associated or non-premultiplied straight alpha format, overriding the file format specific default. This keyword has no effect on files without an alpha channel. Like the gamma, it MUST immediately follow the filename, though the order does not matter.

Note: The following mechanism has some limitations with colored highlights.

When generating non-premultiplied alpha output to a classic low-dynamic-range file format (e.g. PNG), transparency of particularly bright areas will now be reduced, in order to better preserve highlights on transparent objects.

Note: When using an input image in a material_map, bump_map, or image_pattern definition, the following conditions apply.

  • For material maps, no alpha premultiplication handling is done whatsoever, instead the data as stored in the file is used.
  • For bump maps and image patterns, images with an alpha channel are treated as if they had a black background, unless the alpha channel itself is used.

Note: See also background and sky_sphere for additional information.

Activating alpha output via Output_Alpha=on or +UA, when used with unsupported file formats generates a warning. Editor's note: Does not belong here.

New as of version 3.7.1, using filter all and transmit all on an image file with an alpha channel is now supported properly (requires #version 3.71 or higher).