Summary: | digiKam does not store correct color profile in JPEG2000 or TIFF images | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Knut Krause <knut.krause> |
Component: | ColorManagement-Profiles | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles, rschweizer |
Priority: | NOR | ||
Version: | 2.8.0 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.3.0 | |
Sentry Crash Report: |
Description
Knut Krause
2010-12-06 10:10:50 UTC
And with PNG, PGF, or JPEG format, it's the same problem ? Gilles Caulier As I said .jpg seems to work fine (as far as I can see). At the moment I got no clue about PNG and PGF. Can try this at home. Regards Gilles, the JP2kloader has these lines: // Set ICC color profile. // FIXME : doesn't work yet! and it even crashed inside libjasper when I tried it. Didn't find any documentation for these functions. The TIFF loader's relevant section is ifdef'ed: #if defined(TIFFTAG_ICCPROFILE) so maybe it needs a certain libtiff version? About JPEG2000 and libjasper, yes, i remember to set this comment. It come from ImageMagick codec. I take a look in this code few year ago. I don't know if it's fixed now. Anyway, I see KDE core switch from Jasper to OpenJPEG to support JPEG2000. Jasper library is not maintained and security problem occur. We need to plan this switch in the future. About libtiff, i think 3.9.x from remotesensing.org must support it as well (I'm not sure about 3.6.x from libtiff.org) Gilles Caulier As far as I see do I use 3.9.4 from remotesensing.org. I maybe can switch to the 4.0.x beta but I'm not sure if this is clever. Knut Just stumbled over this. Current status: TIFF works, JP2K does not work, PGF does not work. Regarding JP2k, Gilles mentioned the need to port to OpenJPEG, which is a rewrite. Regarding PGF, I don't know if it has been discussed before, bug I'd like to ask Raphael if there's any special support in libpgf or the PGF format to embed an ICC profile. Marcel, JP2K API from Jasper lib do not work to store ICC profile. I already tested it. I already implemented this feature, but, it don't work... Jasper lib is not maintained now. OpenJPEG must be used instead... About PGF, i think it don't support ICC profile storage, but i'm not fully sure. We must ask to Raphael. Note that i work a lots recently into libpgf to port to CMake and to improve Binary compatibility : http://libpgf.svn.sourceforge.net/viewvc/libpgf/cmakeport/ http://libpgf.svn.sourceforge.net/viewvc/libpgf/bincomp/ Gilles Marcel, Gilles PGF in principle supports storing arbitrary unstructured meta-data. This is supposedly not very well suited for ICC profiles (except for use within a bunch of compatible applications). AFAIK Chris made some progress for storing structured data in MS Media Foundation. I will check with him to see whether (and if yes, how) we can incorporate that part into PGF itself. - Raphael Marcel, In all case, we can use Exif to store ICC profile as well. There is a tag dedicated for that. This will mean than it's not store outside image Exif/IPTC/XMP as TIFF or PNG do, but as we store already Exif in PGF as an empty PNG image container, we can add ICC into it. Note : i'm not sure if digiKam read this exif tag to extract ICC profile. Look here for info : http://www.exiv2.org/tags.html Tag is : 0x8773 34675 Image Exif.Image.InterColorProfile Undefined Contains an InterColor Consortium (ICC) format color space characterization/profile Gilles Caulier Yes we do: IccProfile DMetadata::getIccProfile() const { // Check if Exif data contains an ICC color profile. QByteArray data = getExifTagData("Exif.Image.InterColorProfile"); ... I though as well to use this for JP2K, better than nothing. Marcel, ...and the same for PGF, until libpgf will provide a dedicated solution Gilles Raphael: I recommend to specify a way to embed the profile somewhere inside the file itself, not as a workaround in the Exif as we do now. Strictly, pixel data are uninterpreted and uninterpretable without an associated profile, only with it they become colors...and the assumption "always sRGB" would make a format unusable for many purposes. Git commit 23fd28f99c788a02e071db1debfe7c9870de163b by Marcel Wiesweg. Committed on 25/07/2012 at 22:29. Pushed by mwiesweg into branch 'master'. Store color profile in Exif as a workaround for missing support in the PGF format. Attempt to do the same for JP2K, but that does not work: When reading, the library successfully returns an sRGB profile, while we cannot change this when creating a file. M +12 -0 libs/dimg/loaders/dimgloader.cpp M +1 -0 libs/dimg/loaders/dimgloader.h M +8 -0 libs/dimg/loaders/jp2kloader.cpp M +11 -0 libs/dimg/loaders/pgfloader.cpp M +18 -0 libs/dmetadata/dmetadata.cpp M +4 -1 libs/dmetadata/dmetadata.h http://commits.kde.org/digikam/23fd28f99c788a02e071db1debfe7c9870de163b Following commit CC in comment #13, this file is fixed since a while. Reopen if necessary. Gilles Caulier |