[GrafX2] #160: The image's transparent colour is included in the palette reduction

5 views
Skip to first unread message

GrafX2

unread,
Nov 12, 2020, 2:18:47 PM11/12/20
to gra...@googlegroups.com
#160: The image's transparent colour is included in the palette reduction
----------------------------------+------------------------
Reporter: littledeviantart32@… | Owner: pulkomandy
Type: defect | Status: new
Priority: major | Milestone: 2.8
Component: GrafX2 | Version: 2.8WIP
Keywords: |
----------------------------------+------------------------
My version: 2.8wip.3023

This image
https://imgur.com/nf4iLAP
Is an image with a transparent background, the transparent colour being
#FF00FF with 0 alpha. Of course it shows up in GrafX2 with 255 alpha.

However, the problem is, even if I set this colour as the background
colour in the "Layers" right click dialog, it is still counted as part of
the colour reduction algorithm. Import this image into GrafX2, set colour
0 as the background colour, and then go to the palette dialogue and reduce
the image to two colours. You will see that the magenta colour has been
changed, showing that GrafX2 counts it as a colour that needs to be
adjusted. This happens whether or not you set the magenta as the
background colour.

Shouldn't GrafX2 ignore it since it is the background colour and shouldn't
try to change its appearance since the "transparent" colour does not
matter to the image's overall colour composition?

--
Ticket URL: <http://pulkomandy.tk/projects/GrafX2/ticket/160>
GrafX2 <http://pulkomandy.tk/projects/GrafX2>
The ultimate 256-color painting program

GrafX2

unread,
Nov 13, 2020, 12:16:14 PM11/13/20
to gra...@googlegroups.com
#160: The image's transparent colour is included in the palette reduction
-----------------------------------+------------------------
Reporter: littledeviantart32@… | Owner: pulkomandy
Type: defect | Status: new
Priority: major | Milestone: 2.8
Component: GrafX2 | Version: 2.8WIP
Resolution: | Keywords:
-----------------------------------+------------------------

Comment (by Thomas Bernard):

I don't really see the problem caused by this behavior

--
Ticket URL: <http://pulkomandy.tk/projects/GrafX2/ticket/160#comment:1>

GrafX2

unread,
Nov 13, 2020, 12:47:49 PM11/13/20
to gra...@googlegroups.com
#160: The image's transparent colour is included in the palette reduction
-----------------------------------+------------------------
Reporter: littledeviantart32@… | Owner: pulkomandy
Type: defect | Status: new
Priority: major | Milestone: 2.8
Component: GrafX2 | Version: 2.8WIP
Resolution: | Keywords:
-----------------------------------+------------------------

Comment (by PulkoMandy):

Well it could be ignored by the algorithm deciding which colors to keep in
the final palette, and never merged with other colors when reducing.
Changing which pixels are transparent when reducing colors seems a bit
unexpected. (I don't know if we already do this or not)

But it will still be counted in the number of reduced colors. 256 colors
is in fact 255+transparency, and likewise, 2 colors would be 1 color +
transparency.

--
Ticket URL: <http://pulkomandy.tk/projects/GrafX2/ticket/160#comment:2>

GrafX2

unread,
Nov 13, 2020, 1:32:09 PM11/13/20
to gra...@googlegroups.com
#160: The image's transparent colour is included in the palette reduction
-----------------------------------+------------------------
Reporter: littledeviantart32@… | Owner: pulkomandy
Type: defect | Status: new
Priority: major | Milestone: 2.8
Component: GrafX2 | Version: 2.8WIP
Resolution: | Keywords:
-----------------------------------+------------------------

Comment (by yrizoud@…):

Grafx2 doesn't load this PNG variant perfectly, but it's a side problem
(the sprite background color should be understood as transparent during
truecolor -> indexed conversion)

I can see how there is a problem for sprites : let's say you have a GIF
with a transparent part and 31 solid colors (total 32 useful indices in
the palette).
If you try to reduce to 16, it should probably 'lock' the transparent
index and pixels that use it, and only merge the other 31 colors into 15.

Even if you tried to reduce to 2, you should get :
- transparent part completely unchanged
- all other pixels colored into the average of all opaque pixels


Grafx2 provides options to manually tag colors to "protect", it works for
things like transparent effect and "copy to spare - remap", but I noticed
even this setting is not respected by the palette's color reduction
function.

--
Ticket URL: <http://pulkomandy.tk/projects/GrafX2/ticket/160#comment:3>
Reply all
Reply to author
Forward
0 new messages