POV-Ray : Newsgroups : povray.unix : PNG images Server Time
2 May 2024 02:03:49 EDT (-0400)
  PNG images (Message 1 to 2 of 2)  
From: John Coppens
Subject: PNG images
Date: 12 Aug 2008 01:04:59
Message: <20080812020457.7358bcef.john@johncoppens.com>
Hello people.

I've been having problems using transparent PNGs as image_maps in Povray.
Some colors just wouldn't get transparent, even following the doc
instructions to the letter (I hope).

I did find some strange issues, which I didn't see addressed anywhere.
Could someone point to where to find an explanation?

This is what I detected:

1) I saved an image - with transparency - to an indexed PNG with
(according to the GIMP) 8 colors in the palette. GIMP does show 8 colors
in the table.

2) Analyzing the PNG, I actually find 9 values in the palette table, where
the first value is designated as the transparent one, and as background
color.

I just guessed I had to define another index in the map, and that worked!

Is there some more in-depth description somewhere?

Thanks
John


Post a reply to this message

From: Anthony D  Baye
Subject: Re: PNG images
Date: 16 Sep 2008 02:00:05
Message: <web.48cf4ad86efcfd7447a0dc000@news.povray.org>
John Coppens <joh### [at] johncoppenscom> wrote:
> Hello people.
>
> I've been having problems using transparent PNGs as image_maps in Povray.
> Some colors just wouldn't get transparent, even following the doc
> instructions to the letter (I hope).
>
> I did find some strange issues, which I didn't see addressed anywhere.
> Could someone point to where to find an explanation?
>
> This is what I detected:
>
> 1) I saved an image - with transparency - to an indexed PNG with
> (according to the GIMP) 8 colors in the palette. GIMP does show 8 colors
> in the table.
>
> 2) Analyzing the PNG, I actually find 9 values in the palette table, where
> the first value is designated as the transparent one, and as background
> color.
>
> I just guessed I had to define another index in the map, and that worked!
>
> Is there some more in-depth description somewhere?
>
> Thanks
> John

One of the things I discovered while working on my Christmas ornament scene last
December was that POV will set all areas not covered by the image to black, So
when working with transparent PNGs as masks, I set all my black areas to
transparent, and made sure that the borders of my masks were black

I also used two images, one white on black, for the mask, and the other
full-color.  The full color image is used as an image_map pigment within a
texture_map using the mask as a pattern.  The effects were quite stunning.

http://webpages.sdsmt.edu/~1305761/images/Ornaments403.png

I can post the source, if anyone is interested.

ADB


Post a reply to this message

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