GNOME Bugzilla – Bug 132322
gimp-levels does not work on grayscale images
Last modified: 2004-01-24 18:35:58 UTC
The gimp-levels function does not appear to work on grayscale images. In particular, the following Script-Fu code does not give the expected results: (set! image 1) ; for example (set! drawable (car (gimp-image-get-active-layer image))) (gimp-image-convert-grayscale image) (gimp-levels drawable 0 150 200 1.00 0 255) The gimp-levels function has no effect on the grayscale image. However, the Image:Layer/Colors/Levels... tool works fine on the grayscale image using the same values. I am using The GIMP 2.0pre2 from here: http://www2.arnes.si/~sopjsimo/gimp/unstable.html
I can confirm this with current CVS on Linux. The problem was probably introduced by the fix to bug #109078. Note that it works properly when you add alpha to the grayscale image.
Indeed, my fix was not quite correct, will fix this today.
Fixed in CVS: 2004-01-24 Michael Natterer <mitch@gimp.org> * tools/pdbgen/pdb/color.pdb (levels, curves): fiddle with the passed channel index only for GRAYA drawables, not for all GRAY drawables. Fixes bug #132322. * tools/pdbgen/pdb/color.pdb: regenerated. * app/tools/gimpcurvestool.[ch] * app/tools/gimplevelstool.[ch]: fixed the same bug here. It never occured because the "channel" field was accidentially initialized with the correct value and never changed after.