POV-Ray : Newsgroups : povray.pov4.discussion.general : What 's best way of making this kind of image ? Server Time: 19 Feb 2019 22:53:23 GMT
  What 's best way of making this kind of image ? (Message 1 to 5 of 5)  
From: zzzzzz
Subject: What 's best way of making this kind of image ?
Date: 17 Apr 2012 18:00:01
Message: <web.4f8dae635795f830b4c5ea110@news.povray.org>
I am now using Povray to create so called picons, on a Dreambox satellite
receiver these icons are shown when you zap to a particular channel, so that you
see the channel logo when that channel is shown.
However, I'm trying to make them transparent, so that I could use any kind of
background and it would not be covered by the background of the picon.

What should be the best way to achieve this ?
The Dreambox expects an 8-bit paletted PNG file
Right now I create the image in TGA format in Povray with the +ua option, so
that the background is transparent.
Then I use Imagemagick to convert this image to GIF, thereby automatically
converting the 24 bit colour with 8 bit alpha channel to a 256 colour palette
file, then convert it with the same tool to PNG.
The result is far from perfect, though.
As you can see from the edges, the edges are rough because of this double
transformation.
I was wondering if there was a way to immediately create such an 8-bit paletted
PNG file from within Povray itself, or if there is another, better way to obtain
this result.
Does anyone know a way of doing this ?


Post a reply to this message


Attachments:
Download '1_0_19_44f_b_1_ffff0000_0_0_0.png' (9 KB)

Preview of image '1_0_19_44f_b_1_ffff0000_0_0_0.png'
1_0_19_44f_b_1_ffff0000_0_0_0.png


 

From: Patrick Elliott
Subject: Re: What 's best way of making this kind of image ?
Date: 18 Apr 2012 02:20:40
Message: <4f8e24f8$1@news.povray.org>
On 4/17/2012 10:54 AM, zzzzzz wrote:
> I am now using Povray to create so called picons, on a Dreambox satellite
> receiver these icons are shown when you zap to a particular channel, so that you
> see the channel logo when that channel is shown.
> However, I'm trying to make them transparent, so that I could use any kind of
> background and it would not be covered by the background of the picon.
>
> What should be the best way to achieve this ?
> The Dreambox expects an 8-bit paletted PNG file
> Right now I create the image in TGA format in Povray with the +ua option, so
> that the background is transparent.
> Then I use Imagemagick to convert this image to GIF, thereby automatically
> converting the 24 bit colour with 8 bit alpha channel to a 256 colour palette
> file, then convert it with the same tool to PNG.
> The result is far from perfect, though.
> As you can see from the edges, the edges are rough because of this double
> transformation.
> I was wondering if there was a way to immediately create such an 8-bit paletted
> PNG file from within Povray itself, or if there is another, better way to obtain
> this result.
> Does anyone know a way of doing this ?
>
Uh... Why not just set the output type to +FN8 +UA (F = file type, N = 
PNG, 8 = 8 bit color, UA = Alpha output on)? I mean, assuming I didn't 
misread the page on those settings... Mind, I have no idea of that is a 
"paletted" map, but I would think that any converter you might use would 
be doing the same thing at setting that color depth. I might be wrong 
though.


Post a reply to this message

From: clipka
Subject: Re: What 's best way of making this kind of image ?
Date: 18 Apr 2012 13:44:17
Message: <4f8ec531$1@news.povray.org>
Am 17.04.2012 19:54, schrieb zzzzzz:

> What should be the best way to achieve this ?
> The Dreambox expects an 8-bit paletted PNG file

Are you sure 24 bit PNG with 8 bit alpha channel doesn't cut it?

> Right now I create the image in TGA format in Povray with the +ua option, so
> that the background is transparent.
> Then I use Imagemagick to convert this image to GIF, thereby automatically
> converting the 24 bit colour with 8 bit alpha channel to a 256 colour palette
> file, then convert it with the same tool to PNG.
> The result is far from perfect, though.

Of course - GIF supports only one single transparent palette entry. As 
far as I know, PNG does support semi-transparent palette entries.

> As you can see from the edges, the edges are rough because of this double
> transformation.

Can't you convert from TGA to 8-bit paletted PNG directly? I'd expect 
Imagemagick to be able to do that stunt.

> I was wondering if there was a way to immediately create such an 8-bit paletted
> PNG file from within Povray itself, or if there is another, better way to obtain
> this result.
> Does anyone know a way of doing this ?

POV-Ray does not support paletted image output in any format; the reason 
is that there are plenty of different ways of choosing a suitable 
palette, and plenty of different ways to dither the image, each with 
their own strength and weaknesses, so we leave that job up to image 
processing software as a post-processing step.


Post a reply to this message

From: Warp
Subject: Re: What 's best way of making this kind of image ?
Date: 18 Apr 2012 14:53:57
Message: <4f8ed585@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> POV-Ray does not support paletted image output in any format; the reason 
> is that there are plenty of different ways of choosing a suitable 
> palette, and plenty of different ways to dither the image, each with 
> their own strength and weaknesses, so we leave that job up to image 
> processing software as a post-processing step.

  In fact, calculating the optimal palette and dithering for a given
image is an extremenly difficult problem, and tons of papers have been
written about the subject. (It also depends on your definition of
"optimal". It's not unambiguous.)

-- 
                                                          - Warp


Post a reply to this message

From: zzzzzz
Subject: Re: What 's best way of making this kind of image ?
Date: 20 Apr 2012 05:55:06
Message: <web.4f90f9b94795eda4b63966750@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 17.04.2012 19:54, schrieb zzzzzz:
>
> > What should be the best way to achieve this ?
> > The Dreambox expects an 8-bit paletted PNG file
>
> Are you sure 24 bit PNG with 8 bit alpha channel doesn't cut it?

Yes, with a 24 bit PNG with 8 bit alpha channel it doesn't work.
An 8 bit indexed PNG works (with transparency or not, but on some skins it looks
better with transparency).

> Can't you convert from TGA to 8-bit paletted PNG directly? I'd expect
> Imagemagick to be able to do that stunt.

I am sure Imagemagick can do it, but the myriad of options was a bit too
difficult for me.

> POV-Ray does not support paletted image output in any format; the reason
> is that there are plenty of different ways of choosing a suitable
> palette, and plenty of different ways to dither the image, each with
> their own strength and weaknesses, so we leave that job up to image
> processing software as a post-processing step.

I can understand this reasoning.
Finally I found a way of doing it, I'm now creating a regular 24 bit PNG image
with alpha channel (+ua), and now I'm using PNGQUANT to convert it to an 8bit
indexed image, mainting transparency.

The result looks a lot better.


Post a reply to this message


Attachments:
Download '1_0_19_44f_b_1_ffff0000_0_0_0.png' (10 KB)

Preview of image '1_0_19_44f_b_1_ffff0000_0_0_0.png'
1_0_19_44f_b_1_ffff0000_0_0_0.png


 

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