POV-Ray : Newsgroups : povray.general : Select distinct colors from image into color_map? : Re: Select distinct colors from image into color_map? Server Time
29 Jul 2024 16:22:25 EDT (-0400)
  Re: Select distinct colors from image into color_map?  
From: clipka
Date: 29 Dec 2010 06:49:05
Message: <4d1b2031$1@news.povray.org>
Am 29.12.2010 09:58, schrieb Le_Forgeron:

> At least 3 issues:
>   * even a gif is converted in a memory image without map (from index to
> rgb values)

Not strictly correct; to save memory, GIF images are stored internally 
as paletted images, too. You're right however insofar as you can't 
access the palette directly.

>   * pixels are lost (sort of), the image is<0,0>  to<1,1>

In POV-Ray 3.7, you can use the min_extent/max_extent function on an 
image_map to get its true dimensions; if you don't use interpolation 
this allows you to loop over all the pixels.

>   * fopen is to be used with text file, not most image's formats: binary.

In POV-Ray 3.7, binary access is supported. However, I wouldn't 
recommend this approach except for very simple image formats.

An alternative would be the PPM format, which comes in a flavor that is 
essentially a plain text table of integers in blank-separated value format.


Post a reply to this message

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