jiayouxjh / grafx2

Automatically exported from code.google.com/p/grafx2
0 stars 0 forks source link

Layer saving : background is transparent #263

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Draw an image, for example using a white background and using black at
index 0 to draw. Save it.The black is transparent...

It's ok when you work on a layered image, but it's not expected when just
saving a simple .gif. Should either be an option or sthing else...

Original issue reported on code.google.com by pulkoma...@gmail.com on 27 Nov 2009 at 12:33

GoogleCodeExporter commented 9 years ago
Yes, and a side effect is when you preview an existing opaque GIF in the 
Save/Load
fileselector: one color will always be considered transparent, which makes the 
image
look different (you see the GUI through).

The issue is  tricky because I need to change the generic save/load mechanism 
that
currently handles image, brush and image/brush preview:
In the first case, transparency index has to be backed up in picture history 
(can
undo/redo a change)
In the second, it has to be ignored,
In the third, it must be taken into account during read.

I checked with GIF, and:
* Layers above 1 will necessarily have a transparent index (this leaves 255 
colors
for image). For the user's simplicity, I really recommend keeping the same color
index for all layers.
* The layer 1 (background) can, optionally, use a transparent color; and this 
color
can then be different from the other.
--> We can separate the values... Allow the user to choose separately :
*) For potential layers: which color marks layer transparency (mandatory)
*) For the background: which color marks image transparency (optional)

I just saw that in Save_GIF(), I forgot to write the current transparent color, 
so it
seems to save a hard-coded zero.

Original comment by yrizoud on 27 Nov 2009 at 3:38

GoogleCodeExporter commented 9 years ago

Original comment by pulkoma...@gmail.com on 12 Jan 2010 at 8:03

GoogleCodeExporter commented 9 years ago
Fixed in r1332. Now by default an image has opaque background.
See issue 110 for background transparency of PNG and GIF file formats.

Original comment by yrizoud on 9 Feb 2010 at 8:07