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 577301 - Dithering with transparency is broken for "positioned" method
Dithering with transparency is broken for "positioned" method
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.6.6
Other All
: Normal normal
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2009-03-30 13:19 UTC by Rob Antonishen
Modified: 2009-07-20 20:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes the reported bug. (847 bytes, patch)
2009-03-30 17:04 UTC, Rob Antonishen
committed Details | Review
Test case with patch (821 bytes, image/png)
2009-03-31 00:34 UTC, Rob Antonishen
  Details

Description Rob Antonishen 2009-03-30 13:19:46 UTC
Please describe the problem:
When an image with an alpha channel is converted to indexed using the "positioned" method and "enable dithering of transparency" checked, the result is wrong.

Steps to reproduce:
1. Create a new image, solid white.
2. Paint anything in it.
3. Add an alpha channel to the background layer.
4. Image>Mode>Indexed, using "positioned" method and "enable dithering of transparency" checked.


Actual results:
The resultant image is mostly transparent.

Expected results:
There should be no transparency, or of there was in the source, there should be properly dithered transparency. The other dither modes work correctly. 

Does this happen every time?
Yes.

Other information:
Comment 1 Rob Antonishen 2009-03-30 17:04:08 UTC
Created attachment 131713 [details] [review]
Fixes the reported bug.

I am unsure why the original code was doing the bit-shifting.  Could have been some legacy dithering stuff.
Comment 2 Rob Antonishen 2009-03-30 17:06:00 UTC
Hope I did this correctly.
Comment 3 david gowers 2009-03-30 23:52:20 UTC
I think this is a duplicate of bug #349882
So, if this patch works fully and gets committed, that should also be closed.
Details on exactly what is a correct result are also found in bug #349882.
Comment 4 Rob Antonishen 2009-03-31 00:34:48 UTC
Created attachment 131739 [details]
Test case with patch

Attached is the result of testing the patch against a crop of the provided image.  While not 100% identical to the provided expected outcome it is very close.  The patch currently uses the same dither matrix for the alpha and colour dithering.
Comment 5 Martin Nordholts 2009-05-17 07:27:53 UTC
Hi! The patch does not apply cleanly on GNOME master any longer. Could you update that, and also submit the patch in the form of a git commit? That makes it into minimal work for maintainers to commit the fix.

Use this command to generate the patch:
git format-patch origin/master..master
Comment 6 Michael Schumacher 2009-05-18 09:55:59 UTC
A bug should not remain unconfirmed if we are actually discussing the attached patch :)
Comment 7 Rob Antonishen 2009-05-18 23:44:34 UTC
(In reply to comment #5)
> Hi! The patch does not apply cleanly on GNOME master any longer. Could you
> update that, and also submit the patch in the form of a git commit? That makes
> it into minimal work for maintainers to commit the fix.
> 
> Use this command to generate the patch:
> git format-patch origin/master..master
> 

Unfortunately, I can't.  I am a windows user only, and am working off the minGW/Msys build.  Sorry.  I couldn't even get svn working for me, so have never even considered trying git.

I was trying to be helpful by providing the diff.  If diff's are not an acceptable way of providing patches, I'm not sure what more I can really do.

-Rob A>
Comment 8 Chris Mohler 2009-05-18 23:56:44 UTC
FWIW, git is available in Cygwin.  There are also standalone packages for windows here (I've never tried them):
http://code.google.com/p/msysgit/downloads/list

Chris
Comment 9 Martin Nordholts 2009-05-19 04:48:38 UTC
Don't get me wrong, patches are always welcomed, but as a maintainer you want things to be as smooth as possible so that you can manage as many patches as possible.
Comment 10 Sven Neumann 2009-05-20 23:38:39 UTC
As simple as the patch is, we should be able to merge it. Setting milestone to 2.6 so that is not forgotten.
Comment 11 Sven Neumann 2009-05-21 17:08:14 UTC
This went into the master branch as commit cbfe411ea15a4dcc6d919123022ed37bcd951b60. We can merge it to the gimp-2-6 branch as soon as it has been tested.
Comment 12 Sven Neumann 2009-07-20 20:50:47 UTC
Cherry-picking failed on this one, but I've now merged the change manually. Closing as FIXED.