Bug 156809 - [PATCH] kimgio doesn't support the GIMP 2.x layer blending modes
Summary: [PATCH] kimgio doesn't support the GIMP 2.x layer blending modes
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kimgio (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-27 22:34 UTC by David Benjamin
Modified: 2008-01-27 22:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch that implements the missing blending modes (8.20 KB, patch)
2008-01-27 22:44 UTC, David Benjamin
Details
Test cases (345.54 KB, application/x-bzip)
2008-01-27 22:47 UTC, David Benjamin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Benjamin 2008-01-27 22:34:01 UTC
Version:            (using KDE 4.0.0)
Installed from:    Compiled From Sources
OS:                Linux

The XCF thumbnailer in kimgio is somewhat outdated. It doesn't support several blending modes in the GIMP 2.x series. I've made a patch that implements the missing ones.

This also has the side-effect that Kolourpaint now opens XCFs correctly.
Comment 1 David Benjamin 2008-01-27 22:44:23 UTC
Created attachment 23315 [details]
Patch that implements the missing blending modes

(Yay! My first non-trivial patch! :-D)

New blending modes:
   DODGE_MODE
   BURN_MODE
   HARDLIGHT_MODE
   SOFTLIGHT_MODE
   GRAIN_EXTRACT_MODE
   GRAIN_MERGE_MODE

Removed:
   ERASE_MODE
   REPLACE_MODE
   ANTI_ERASE_MODE
These appear to have been internal things or something... there isn't such a
mode in the UI, their spots in the enums have been overwritten in the new GIMP
sources, and no implementation of them was ever made for kimgio. (Similarly,
the GIMP 2.x "blending mode" COLOR_ERASE isn't in this patch... I think it's
internal.)

Other stuff:
Some files take a few seconds to render and thumbnail. The GIMP has MMX, SSE,
etc. instructions. I don't know whether it'd be worth doing something like that
here. I'll try to refactor the code in any case and see if I can make it a bit
faster later. (Probably not really worth it to have several versions of each
blending mode and a switch on each pixel... the GIMP uses separate functions
for each mode which handle each pixel format and do all pixels.)

Also, would it be reasonable, for really big XCFs, to scale first, then blend?
Especially for a thumbnail, I don't think the minor loss in accuracy would be
important.

Also, there was a slight typo in one of the comments in gimp.h.

And... hopefully I didn't do anything stupid like forget a break or something.
Comment 2 David Benjamin 2008-01-27 22:47:35 UTC
Created attachment 23316 [details]
Test cases

Including all the new blending modes.
Comment 3 Urs Wolfer 2008-01-27 22:54:13 UTC
SVN commit 767369 by uwolfer:

Add support for GIMP 2.x layer blending modes.
Patch by David Benjamin, thanks.
BUG:156809

 M  +9 -4      gimp.h  
 M  +258 -3    xcf.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=767369