[Kde-imaging] [Bug 146259] Raw Converter won't convert to 16bit PNG
Gilles Caulier
caulier.gilles at gmail.com
Sun Sep 23 14:05:11 CEST 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=146259
caulier.gilles gmail com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |casta xwing info
------- Additional Comments From caulier.gilles gmail com 2007-09-23 14:05 -------
Martin,
Kipi-plugins for KDE4 is able to convert RAW to PNG in 16 bits color depth.
Do not claim than you have a black hole image in this case because the target pictures is not corrected using a Color Management (like digiKam image editor do). dcraw produce a decoded linear image. It's different than 8 bits mode where gamma is automatically corrected.
You need to fix color/gamma by hand later using your prefered program witch support 16 bits color depth and color management : digiKam, cinepaint, or Krita.
Important : Gimp only support 8 bits color depth !
Guillaume, Marcel,
TIFF file format is supposed work properlly with 16 bits batch conversion. The code to write tiff image in 16 bits is very similar than digiKam DImg::TiffLoader... But it doesn't work. The image is completly broken on my computer. Of course, if i use digiKam image editor to save tiff in 16 bits all work fine!
After few investigations, i can said :
- In 8 bits color depth all work fine with TIFF.
- If i disable LZW tiff compression, all work fine.
Code from digiKam is in digikam/libs/dimg/loaders/tiffloader.cpp on method save().
Code of TIFF writer used by plugin is in kipi-plugins/common/libkipiplugins/kpwriteimage.cpp on method write2TIFF().
To have a propers tiff image with the plugin, just comments these lines in kpwriteimage.cpp :
TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_ADOBE_DEFLATE);
TIFFSetField(tif, TIFFTAG_ZIPQUALITY, 9);
// NOTE : this tag values aren't defined in libtiff 3.6.1. '2' is PREDICTOR_HORIZONTAL.
// Use horizontal differencing for images which are
// likely to be continuous tone. The TIFF spec says that this
// usually leads to better compression.
// See this url for more details:
// http://www.awaresystems.be/imaging/tiff/tifftags/predictor.html
TIFFSetField(tif, TIFFTAG_PREDICTOR, 2);
... of course in this case the tiff file is huge (non-compressed). This is weird.
I don't know where is the difference between digiKam and kipi-plugins implementation. I suspect a problem with zlib witch is used to commpress image data. Perhaps something is wrong to link libkipiplugin shared library ?
Can you reproduce this problem on your computer ?
Gilles Caulier
More information about the Kde-imaging
mailing list