Bug 118539 - wish: lossless image-editor for JPEGs
Summary: wish: lossless image-editor for JPEGs
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-JPEG (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-17 21:20 UTC by S. Burmeister
Modified: 2017-08-02 06:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.9.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description S. Burmeister 2005-12-17 21:20:09 UTC
Version:           0.8 (using KDE KDE 3.5.0)
Installed from:    SuSE RPMs
OS:                Linux

It would be very nice, if removing red-eyes and other little improvements before printing photos would occur lossless.
Comment 1 Peter 2006-03-05 15:33:25 UTC
Are the existing "image rotations" (90, 180 and 270 degrees) done losslessly?

The documentation does not seem to say...
Comment 2 Alan Horkan 2006-03-22 11:21:47 UTC
lossless cropping would rock (and by lossless I mean without reencoding the jpeg, crop is lossey by definition)
Comment 3 sero4linux 2006-03-22 11:54:52 UTC
I already had a lenghty discussion about this earlier with the digikam team.
I try to give a short summary of what it ended like.

The Image Editor (IE) of digikam works completely lossless internal - it's the file format jpg that produces the lossy compression. So if you want lossless, then save as png or tiff.

Speaking of the special case lossless crop for jpeg I know the that is possible my jpegtrans tools. If you want this feature implemented in digikam the right place wouldn't be IE (cause it is transparent for all image file formats) but a kipi-plugin (like the lossless rotate kipi-plugin). So this bug should then be against kipi-plugins. 

But be warned: the kipi-team is quite understuffed atm so there is not much going on. And I can't remember exactly whether the kipi-api must be extended for this case and how the whole thing could be integrated into IE (from the users perspective) also it is technically a kipi-plugin.   
Comment 4 S. Burmeister 2006-03-22 21:20:57 UTC
What about a warning? Editing the image and then saving should trigger a notification that JPEG is not lossless. The user should be given the option to "export" the image, as gimp does it, i.e. save with another filename, or save it as PNG.
Comment 5 sero4linux 2006-03-23 13:49:52 UTC
I am all for giving the user a feetback what actions are lossless and what are lossy. The best place to archive that is in my opinion the digikam handbook (there allready are some infos about, but this might be extended). 

A second good place from my point of view is the "filter" section in the save dialog. There you currently can choose jpg, png, etc. as image formates. When you add a little(!) more information for each entry, like "PNG (Recommended)" or "JPG (Atention: Lossy)" then this might help some users find the right decission. For further questions a "help" butoon would be great that brings the curious user to the appropriate section of the handbook.

I don't like the idea of a warning message, cause this might just get "in the way" of most users. I am not sure about "save/export" separation cause I'd say most people do not realy know the difference. It's even more difficult for apps like digikam that have not a real default file format (jpg, png, tiff?).So I like the idea to use save as for all the image file formats and export for other kinds of storing pictures (like html export, flicr). Thats perfectly clear to me.

When this ideas get some possitive feetback I can review the handbook sections whis regard to this problem and write up a section about file formats and how they are handled with digikam (the secrion that should come up with the "help" button of the save dialogue).
Comment 6 caulier.gilles 2006-03-23 14:01:18 UTC
#1 about digikam handbook, i'm full agree with you. More informations about lossless file formats must be added.

#2 about save dialog : yes you can add a warning message, but take a care that the save dialog will be improved later 0.9.0 final release. all save image settings from setup will be moved to dedicaced dialog (JPEG/PNG/TIFF, etc.) like krita, gimp, photoshop do. Do it for 0.9.0 only if the implementation is easy to do. Added an Help button with an handbook link is very easy and already done in others digiKam part like image plugins dialogs.

#3 I'm agree too. No need to give advanced warning messages. The digiKam book is avaialble for more and more informations... I think that "Save" option is enough and we don't need to add another one like "Export". 

Gilles Caulier
Comment 7 S. Burmeister 2006-03-24 11:21:31 UTC
Adding information to the handbook, IMO is not feedback. People do not read the handbook before using digikam.

Hence, there must be a warning/notification when saving to inform the user about the loss of quality and point the user to the handbook with a link the user can clik on to get to the relevant position in the handbook. I think some "What's This" helps have this linkt to the handbook too.

The problem about "Save As..." is that it is actually a "Save copy" and the user continues to edit the original. As long as this is the case, "Save As..." does not serve the purpose needed for this bug, i.e. leave the original alone and save the edited as xyz AND continue to edit that copy and not the original, so that next time the user clicks "save", the changes to the image are not saved to the original but to the copy!
Comment 8 Marcel Wiesweg 2006-03-24 12:25:55 UTC
As to the "Save As" situation: In current development series, this is solved a bit differently. When saved with save as, the new file name is set as the current one (only if the new path is in the album hierarchy), so you will "save" to this. The newly saved image, however, is not reloaded, but the data is untouched, i.e. compression effects are not visible as long as the file is kept open in the image editor. (In fact, the in-memory representation is almost completely agnostic of the format it is loaded from or saved to).

Currently, all this is absolutely intransparent to the user. While it will certainly be mentioned in the docs, I have been thinking of a way how to notify the user of some of these facts:
- he is working on the new image
- he is _not_ working on the new image, if saved outside album hierarchy
- compression artefacts are not visible
- saving is/is not lossless


Comment 9 caulier.gilles 2006-03-24 12:34:56 UTC
==> Adding information to the handbook, IMO is not feedback. People do not read the handbook before using digikam. 

This is a wrong reflection ! We have works very very hard (especially me) to provide a full handbook with large descriptions about digital imagery. digikam and digikamimageplugins handbook sounds like a commercial manual. If _YOU_ don't care about to read the documentation that we have provide,  is your problem... but don't generalise your viewpoint.

Have you already take a look into digikam &co handbook ?

http://docs.kde.org/development/en/extragear-graphics/digikam/index.html
http://docs.kde.org/development/en/extragear-graphics/digikamimageplugins/index.html

In conclusion : i'm sure that digiKam handbook must be improved to give more informations about lossless file format.

Gilles Caulier


Comment 10 sero4linux 2006-03-24 13:05:14 UTC
I agree with Gilles as far as the the handbook thing goes. It can NOT be the task of a Save Dialog to inform a user about all the details in image file formats. It's only task is to make thinks transparent to the user as MArcel wrote above and I mentioned allready, too. In this case it seems important for me that the terms "lossy" and "lossless" appear on a reasonable place in the dialogues so the user should understand at the first look which file formats are lossy and which are not. But flashing warning messages everytime I save as jpg would just be a pain.

When the user sees in the interface that there are lossy and lossless file formats and he dosn't know what that means, then it is HIS task to search for the background knowledge (read a photoshop book, look at the digikam manual, search the net). You can not put all that infos in the save dialogue.

The help button that brings you to the right section in the handbook is a bonus (most commercial WIN software doesn't have it) but it's a good thing (TM) and easy to archive from the devels perspective. So it will be there once somebody (me?) wrote a good section about file formats in the handbook.

I will wait what changes are done to the save dialogue in 0.9 as Gilles recommented and then we can collect ideas on this problem again.

As far as the save as thing goes, I agree with you, this should be fixed to a real "save as". Please fill a seperate bug report for it. Thanks!

P.S. Regarding file formats I find it important which metadata types are supported by eacg, too. This is exspecially important for backups that you might use with other apps from the WIN world (like photoshop). I would not use PNG at that time cause the metadata can not be read by other apps.
Comment 11 S. Burmeister 2006-03-24 13:23:00 UTC
I stated: _before_ using digikam. It's good that the handbook is of a high quality and people should use it. BUT people do not read and should not have to read the manual before trying to use digikam the first time. They import their pictures and try digikam's functions. This should not lead to unnoticed data-loss!

I never said that all the information should be put in the save-dialogue. But it is just a fact that most people first use an app and then go into details. So reading the manual is not the first thing they do, sorry.

If the user opens an image, edits it and saves it, how is one informed about the loss of data? There is no "lossy-information" for "save" because the format cannot /is not changed, i.e. there is no file-dialogue. This is/would only visible for "save as".

So I still think that there is the need to warn before saving JPEGs. Users that remove red-eyes do not use "save as" but "save" and hence have no chance to see the "lossy-warning" in the file-dialogue.

Of course it is true that this is annoying for users that do know about this. Yet, as with all things preventing data-loss, it is necessary! Especially as the solution is that simple. "JPEG is a lossy file-format... More information can be found here (link)" and a checkbox "do not warn anymore". This prevents data-loss and only adds one click for those that know already about it. A small price to pay for preventing data-loss.

I agree about the meta-data being an important piece of information. Hence PNG should not be the recommended format, but only a format that is lossless in terms of the picture and meta-data.
Comment 12 caulier.gilles 2006-03-24 13:34:09 UTC
> Hence PNG should not be the recommended format, but only a format that is lossless in terms > of the picture and meta-data. 

Not completly right !

The first way to backup metadata into PNG file are raw profiles, and digikam image editor support ImageMagick raw Exif/iptc profile to save EXIF and IPTC metadata ! 

Try this command line (with foo1.jpg is a file with Exif info) :

# convert foo1.jpg foo2.png
# convert foo2.png foo3.jpg

Now look the results into digikam or showfoto metadata tab ! foo3.jpg have the same EXIF info of foo1.jpg

The second way is chunk creation like photoshop does (i think). I study this way for the next release (later 0.9.0 issue).

Gilles Caulier
Comment 13 Thiago Macieira 2006-03-25 15:18:04 UTC
The KDE HIG says "Save" should be preserve all information and "Export" should allow making a copy that has less information.

That works Ok for programs such as KWord and KSpread, in which there is a native format to save to. For digikam, this would be awkward, since you can open a JPEG, but you wouldn't be able to save it again, since it's lossy...

The alternative would be to apply the same separation to Open/Import. But that adds even more awkwardness: users can't open JPEG anymore! They have to import it.

That's an interesting question to solve.
Comment 14 caulier.gilles 2007-02-08 16:48:47 UTC
SVN commit 631612 by cgilles:

digikam from trunk : JPEG file save settings widget : add a "RED" warning message about this lossy compression image file format. An url link to wikipedia is given to learn more about JPEG...

This warning is displayed in Setup Save File dialog page and in Save File Dialog from editor

CCBUGS: 118539

 M  +17 -1     jpegsettings.cpp  


--- trunk/extragear/graphics/digikam/libs/dimg/loaders/jpegsettings.cpp #631611:631612
@@ -30,6 +30,7 @@
 #include <klocale.h>
 #include <kdialog.h>
 #include <knuminput.h>
+#include <kactivelabel.h>
 
 // Local includes.
 
@@ -49,12 +50,15 @@
         JPEGGrid             = 0;
         labelJPEGcompression = 0;
         JPEGcompression      = 0;
+        labelWarning         = 0;
     }
 
     QGridLayout  *JPEGGrid;
 
     QLabel       *labelJPEGcompression;
 
+    KActiveLabel *labelWarning;
+
     KIntNumInput *JPEGcompression;
 };
 
@@ -63,7 +67,7 @@
 {
     d = new JPEGSettingsPriv;
 
-    d->JPEGGrid        = new QGridLayout(this, 1, 1, KDialog::spacingHint());
+    d->JPEGGrid        = new QGridLayout(this, 1, 2, KDialog::spacingHint());
     d->JPEGcompression = new KIntNumInput(75, this);
     d->JPEGcompression->setRange(1, 100, 1, true );
     d->labelJPEGcompression = new QLabel(i18n("JPEG quality:"), this);
@@ -77,8 +81,20 @@
                                              "large file size)<p>"
                                              "<b>Note: JPEG is not a lossless image "
                                              "compression format.</b>"));
+
+    d->labelWarning = new KActiveLabel(i18n("<qt><font size=-1 color=\"red\"><i>"
+                          "Warning: <a href='http://en.wikipedia.org/wiki/JPEG'>JPEG</a> is a<br>"
+                          "lossy compression<br>"
+                          "image format!</p>"
+                          "</i></qt>"), this);
+
+    d->labelWarning->setFrameStyle(QFrame::Box | QFrame::Plain);
+    d->labelWarning->setLineWidth(1);
+    d->labelWarning->setFrameShape(QFrame::Box);
+
     d->JPEGGrid->addMultiCellWidget(d->labelJPEGcompression, 0, 0, 0, 0);
     d->JPEGGrid->addMultiCellWidget(d->JPEGcompression, 0, 0, 1, 1);
+    d->JPEGGrid->addMultiCellWidget(d->labelWarning, 0, 0, 2, 2);    
     d->JPEGGrid->setColStretch(1, 10);
 }
 
Comment 15 caulier.gilles 2007-03-28 10:21:26 UTC
Since digiKam 0.9.1 is out, we provide a warning message in SaveAs dialog of editor about lossy quality performed by JPEG codec. there is an active link to wikipedia JPEG page.

I close this file now.

Gilles Caulier
Comment 16 caulier.gilles 2007-03-28 10:22:48 UTC
*** Bug has been marked as fixed ***.