After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 313458 - palette-map does not work 'as advertised'
palette-map does not work 'as advertised'
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
git master
Other All
: Normal normal
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-08-14 13:20 UTC by david gowers
Modified: 2005-08-27 18:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix palette-map to map palettes != 256colors correctly (1.18 KB, patch)
2005-08-14 13:21 UTC, david gowers
committed Details | Review

Description david gowers 2005-08-14 13:20:00 UTC
the help says 'a complete black pixel becomes the lowest palette index, and
complete white becomes the highest.'
The actual behaviour is to interpret intensities directly as indices, Clipping
at the end of the palette, so that if you have a 4-color palette, anything
brighter than 3/255 will be mapped to the final palette entry.

This patch fixes it, so that the input range [0.255] really does map to
[0..max_pal_entry].
Comment 1 david gowers 2005-08-14 13:21:44 UTC
Created attachment 50681 [details] [review]
fix palette-map to map palettes != 256colors correctly
Comment 2 Michael Natterer 2005-08-14 22:08:46 UTC
That looks indeed broken, however the patch would change the plug-in's
behavior, so it should probably go only into CVS HEAD.

Setting milestone to 2.4
Comment 3 weskaggs 2005-08-15 23:09:58 UTC
Palette-map is new as of GIMP 2.3, and the current behavior is what I intended
when I wrote it, thinking that people would be happiest having each gray level
map to the corresponding palette index.  But it wouldn't bother me much if this
were changed.  The plug-in does not actually have any help; this bug report is
referring to the blurb, which I was careless in modifying from the one for the
gradient map plug-in.
Comment 4 david gowers 2005-08-16 01:43:49 UTC
It is MUCH more useful this way. I usually use it with a palette of 16 or less,
for pixel-art. This is good for controlled color reduction + color swaps.
A 256-entry palette produces the same result as before.. so if you really want
the clipping effect (why?!) you can just pad the palette to 256 entries with the
last valid color.
Comment 5 Sven Neumann 2005-08-17 17:28:45 UTC
I tend to agree with David here, I would have expected the behaviour that he
describes.
Comment 6 Michael Schumacher 2005-08-27 10:10:26 UTC
This patch does work as advertized, so I think it should go in.
Comment 7 Michael Schumacher 2005-08-27 18:13:20 UTC
2005-08-27  Michael Schumacher  <schumaml@cvs.gnome.org>

	* plug-ins/common/gradmap.c: applied a patch by David Gowers,
	which makes palette-map behave the same as gradient-map. Fixes bug
	313458.