POV-Ray : Newsgroups : povray.newusers : GIF: how to define color number in linux? Server Time
22 Dec 2024 00:01:01 EST (-0500)
  GIF: how to define color number in linux? (Message 1 to 9 of 9)  
From: LanuHum
Subject: GIF: how to define color number in linux?
Date: 2 Dec 2013 12:10:00
Message: <web.529cbda88880fddf7a3e03fe0@news.povray.org>
Hi!
Sorry!
In doc:
image_map {
  gif "mypic.gif"
  filter   0, 0.5 // Make color 0 50% filtered transparent
  filter   5, 1.0 // Make color 5 100% filtered transparent
  transmit 8, 0.3 // Make color 8 30% non-filtered transparent
  }

How to define, what indexes in my picture? 0, 5, 8 or 7, 256, 119, 17...
Don't advise to me to buy Photoshop and Windows-8 :)
Me means of programming in linux interest.


Post a reply to this message

From: Le Forgeron
Subject: Re: GIF: how to define color number in linux?
Date: 2 Dec 2013 12:30:18
Message: <529cc3aa$1@news.povray.org>
Le 02/12/2013 18:05, LanuHum nous fit lire :
> Hi!
> Sorry!
> In doc:
> image_map {
>   gif "mypic.gif"
>   filter   0, 0.5 // Make color 0 50% filtered transparent
>   filter   5, 1.0 // Make color 5 100% filtered transparent
>   transmit 8, 0.3 // Make color 8 30% non-filtered transparent
>   }
> 
> How to define, what indexes in my picture? 0, 5, 8 or 7, 256, 119, 17...
> Don't advise to me to buy Photoshop and Windows-8 :)
> Me means of programming in linux interest.
> 
> 
> 
To find the index of color map on linux, I recommend using Gimp.

Load your gif in the program, then if the colormap is not displayed
automatically, go to Windows->Dockable Dialogs->Colormap

You can even reorder the color map with Rearrange Colormap (rightclick
menu of the colormap, when selecting a color from the
colormap)(rearranging does not change the display of the picture, only
the order in the color map)


Post a reply to this message

From: LanuHum
Subject: Re: GIF: how to define color number in linux?
Date: 2 Dec 2013 13:55:00
Message: <web.529cd6f4f74b61377a3e03fe0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

> To find the index of color map on linux, I recommend using Gimp.
>
> Load your gif in the program, then if the colormap is not displayed
> automatically, go to Windows->Dockable Dialogs->Colormap
>
> You can even reorder the color map with Rearrange Colormap (rightclick
> menu of the colormap, when selecting a color from the
> colormap)(rearranging does not change the display of the picture, only
> the order in the color map)

Thanks!

But, if I create GIF in GIMP-2.8:
Povray wrote:
Possible Parse Error:
Interlacing in GIF image unsupported
Fatal error in parser: Cannot access data in file.
Render failed


But, I convert GIF(create with GIMP) to PNG in konqueror, than PNG to GIF in
konqueror:
Render good, no error.

As it is correct to create GIF in GIMP for Povray?


Post a reply to this message

From: Le Forgeron
Subject: Re: GIF: how to define color number in linux?
Date: 2 Dec 2013 15:40:31
Message: <529cf03f@news.povray.org>
Le 02/12/2013 19:52, LanuHum nous fit lire :
> Le_Forgeron <jgr### [at] freefr> wrote:
> 
>> To find the index of color map on linux, I recommend using Gimp.
>>
>> Load your gif in the program, then if the colormap is not displayed
>> automatically, go to Windows->Dockable Dialogs->Colormap
>>
>> You can even reorder the color map with Rearrange Colormap (rightclick
>> menu of the colormap, when selecting a color from the
>> colormap)(rearranging does not change the display of the picture, only
>> the order in the color map)
> 
> Thanks!
> 
> But, if I create GIF in GIMP-2.8:
> Povray wrote:
> Possible Parse Error:
> Interlacing in GIF image unsupported
> Fatal error in parser: Cannot access data in file.
> Render failed
> 

Holy cow!

You have found the deepest bug of Povray: it read 9 bytes of image block
in buffer[] from 0 to 8, and test buffer[9] instead of buffer[8] for
interlacing.
(in file gif.cpp for Povray 3.7, circa line 158)
The bug was not in 3.1g; and not yet in 3.6.1;

Congratulations.

I now have to report that bug.

> 
> But, I convert GIF(create with GIMP) to PNG in konqueror, than PNG to GIF in
> konqueror:
> Render good, no error.
> 
> As it is correct to create GIF in GIMP for Povray?

If the code was correct, it would be fine with Gimp. So far the issue is
that Gimp put the comment block before the image block, and if the Ninth
bytes of the comment has the bit 0x40 set, you're dead.
So: "Created with GIMP" being the default comment, you are killed by the
w of with. (0x77). (if there is no comment, or a shorter one, it might
still be amusing for that buffer overrun from previous read...)

The convertion between gif-gimp to png to gif again might move the
blocks, or drop some.


Post a reply to this message

From: Alain
Subject: Re: GIF: how to define color number in linux?
Date: 2 Dec 2013 15:41:33
Message: <529cf07d$1@news.povray.org>


>
> Thanks!
>
> But, if I create GIF in GIMP-2.8:
> Povray wrote:
> Possible Parse Error:
> Interlacing in GIF image unsupported
> Fatal error in parser: Cannot access data in file.
> Render failed
>
>
> But, I convert GIF(create with GIMP) to PNG in konqueror, than PNG to GIF in
> konqueror:
> Render good, no error.
>
> As it is correct to create GIF in GIMP for Povray?
>
>
>
>
Interlacing mean that the lines are not consecutives. First, you have 
the even lines, then the odd ones.

Check your options for saving as GIF. UNCHECK "Save as interlaced".
Do that for all format that offer that option.
Also, uncheck any "progressive" option.



Alain


Post a reply to this message

From: Le Forgeron
Subject: Re: GIF: how to define color number in linux?
Date: 2 Dec 2013 15:58:36
Message: <529cf47c$1@news.povray.org>
Le 02/12/2013 21:40, Le_Forgeron nous fit lire :
> Le 02/12/2013 19:52, LanuHum nous fit lire :

> If the code was correct, it would be fine with Gimp. So far the issue is
> that Gimp put the comment block before the image block, and if the Ninth
> bytes of the comment has the bit 0x40 set, you're dead.
> So: "Created with GIMP" being the default comment, you are killed by the
> w of with. (0x77). (if there is no comment, or a shorter one, it might
> still be amusing for that buffer overrun from previous read...)

Correction, it's the "i" of with that's blocking. But that's only a details.


Post a reply to this message

From: clipka
Subject: Re: GIF: how to define color number in linux?
Date: 2 Dec 2013 16:00:20
Message: <529cf4e4@news.povray.org>
Am 02.12.2013 21:58, schrieb Le_Forgeron:
> Le 02/12/2013 21:40, Le_Forgeron nous fit lire :
>> Le 02/12/2013 19:52, LanuHum nous fit lire :
>
>> If the code was correct, it would be fine with Gimp. So far the issue is
>> that Gimp put the comment block before the image block, and if the Ninth
>> bytes of the comment has the bit 0x40 set, you're dead.
>> So: "Created with GIMP" being the default comment, you are killed by the
>> w of with. (0x77). (if there is no comment, or a shorter one, it might
>> still be amusing for that buffer overrun from previous read...)
>
> Correction, it's the "i" of with that's blocking. But that's only a details.

Are you already working on the fix?


Post a reply to this message

From: Le Forgeron
Subject: Re: GIF: how to define color number in linux?
Date: 2 Dec 2013 16:17:47
Message: <529cf8fb@news.povray.org>
Le 02/12/2013 22:00, clipka nous fit lire :
> Am 02.12.2013 21:58, schrieb Le_Forgeron:
>> Le 02/12/2013 21:40, Le_Forgeron nous fit lire :
>>> Le 02/12/2013 19:52, LanuHum nous fit lire :
>>
>>> If the code was correct, it would be fine with Gimp. So far the issue is
>>> that Gimp put the comment block before the image block, and if the Ninth
>>> bytes of the comment has the bit 0x40 set, you're dead.
>>> So: "Created with GIMP" being the default comment, you are killed by the
>>> w of with. (0x77). (if there is no comment, or a shorter one, it might
>>> still be amusing for that buffer overrun from previous read...)
>>
>> Correction, it's the "i" of with that's blocking. But that's only a
>> details.
> 
> Are you already working on the fix?
> 
I'm working on the report (FS#314), but a second pair of eyes is
welcome, and I'm not trying to fix it tonight, so feel free to take the
hand on it and push a correction.


Post a reply to this message

From: LanuHum
Subject: Re: GIF: how to define color number in linux?
Date: 3 Dec 2013 13:20:00
Message: <web.529e20abf74b61377a3e03fe0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
>
> Holy cow!

> So: "Created with GIMP" being the default comment, you are killed by the
> w of with. (0x77). (if there is no comment, or a shorter one, it might
> still be amusing for that buffer overrun from previous read...)
>

Thanks! No comment - very good! :)


Post a reply to this message

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