Suggestion: Unsharp mask

camelreef

Joined: 2003-08-10
Posts: 13
Posted: Fri, 2004-08-13 14:20

Hi all,

I have a suggestion: would it be tough to add an unsharp mask at least in the thumbnail making process?

Images tend to become quite soft after going through size reduction, at least using the NetPBM algorithms. A bit of unsharp mask would bring back a good amount of details.

NetBPM now has a tool for that: pammasksharpen
ImageMagick has that as well through the "composite" tool, I think.

I understand that unsharp mask cannot be the same for every picture for optimal results, but a minimal application would be great. Finetuning the parameters could be in the Admin panels.

I wish I had the expertise to code that myself...

Nico
Very happy Gallery user, thanks!
http://rdo.homelinux.org

 
Jean-Marc Liotier
Jean-Marc Liotier's picture

Joined: 2004-03-07
Posts: 80
Posted: Tue, 2004-08-17 14:17

Making unsharp mask part of an automated process is not something that will yield nice results : consumer digital cameras already sharpen their pictures way too much in order to compensate for the softness of their cheap glass, so automatically adding more on top of it is not really going to do any good. Even if each user, or each album has preferences for a certain USM level, even pictures from a same "roll" have different filtering needs. That's true of USM, but also of the other common tools that are part of the digital photography basic workflow : cropping, curves, levels, contrast/lighting, despeckle, unsharp mask and others.

I fail to see how to design that correctly save making Gallery a sort of web image edition program. Some image enhancement is part of my workflow, but it takes trial and error to get an image right, so there would have to be a loop for entering paramaters, viewing results and feeding back modifications into the paramaters until the desired result is achieved. That is a major extension.

From what I understand, Gallery is the tail-end of the workflow : it handles the publication. Extending it to handle the upstream parts of the process is probably stretching the perimeter of its functionnality beyond the vision of its current designers.

System architecture is also a concern : images are created or transfered from a camera on a workstation, so why work on them on a server where the load will be concentrated instead of doing it on the workstation were there is almost always ample CPU and RAM available ? Unsharp mask requires a hefty chunk of CPU time.

 
camelreef

Joined: 2003-08-10
Posts: 13
Posted: Tue, 2004-08-17 14:29

I am a 100% with you regarding Unsharp Mask on the picture itself, though digital cameras produce soft images out of the CDD not only because of cheap glass, but mainly because of of the filters in front of the sensor and because of interpolation.

Unsharp Masking on the main picture should be kept a part of the user's workflow, granted.

I was asking for an unsharp mask on the resized pictures, mainly for the thumbnails, as, again, interpolation during the resize greatly softens the results.

Nico

 
Jean-Marc Liotier
Jean-Marc Liotier's picture

Joined: 2004-03-07
Posts: 80
Posted: Tue, 2004-08-17 16:30
camelreef wrote:
I was asking for an unsharp mask on the resized pictures, mainly for the thumbnails, as, again, interpolation during the resize greatly softens the results.

I had not thought about that. Maybe a gallery with sample thumbnails for a side by side comparison of thumbnails with and without sharpening applied would feed the discussion nicely.

 
camelreef

Joined: 2003-08-10
Posts: 13
Posted: Wed, 2004-08-18 20:25

OK, I made some examples, all visible here.

I took a thumbnail directly from the gallery, applied some unsharp mask, did a "Save for the web..." with 95% quality.

File size is bigger because of the quality setting and because...there are more details!

Sharpness should be better if working from the original, before final save as a compressed JPEG, as it would probably happen in a Gallery script.

Original Gallery Thumb - New unsharp masked thumb

[img]http://rdo.homelinux.org/~will/exemples_unsharp/DSCN8672_nico.highlight.jpg[/img] [img]http://rdo.homelinux.org/~will/exemples_unsharp/DSCN8672_nico.highlight.um.jpg[/img]

[img]http://rdo.homelinux.org/~will/exemples_unsharp/IMG_0024.thumb.jpg[/img] [img]http://rdo.homelinux.org/~will/exemples_unsharp/IMG_0024.thumb.um.jpg[/img]

[img]http://rdo.homelinux.org/~will/exemples_unsharp/IMG_0527.thumb.jpg[/img] [img]http://rdo.homelinux.org/~will/exemples_unsharp/IMG_0527.thumb.um.jpg[/img]

[img]http://rdo.homelinux.org/~will/exemples_unsharp/IMG_0530.thumb.jpg[/img] [img]http://rdo.homelinux.org/~will/exemples_unsharp/IMG_0530.thumb.um.jpg[/img]

[img]http://rdo.homelinux.org/~will/exemples_unsharp/img_0026.thumb.jpg[/img] [img]http://rdo.homelinux.org/~will/exemples_unsharp/img_0026.thumb.um.jpg[/img]

[img]http://rdo.homelinux.org/~will/exemples_unsharp/img_0030.thumb.jpg[/img] [img]http://rdo.homelinux.org/~will/exemples_unsharp/img_0030.thumb.um.jpg[/img]

Point made? :wink: Sure, I may have pushed the sharpenning a bit far, but it doesn't invalidate my demonstration, does it?

It is nice to recover such details, even after lossy compression...

This would make the thumbnails much more attractive.

Nico

 
Jean-Marc Liotier
Jean-Marc Liotier's picture

Joined: 2004-03-07
Posts: 80
Posted: Wed, 2004-08-25 14:29
camelreef wrote:
OK, I made some examples, all visible here.
[..]
Point made? :wink: Sure, I may have pushed the sharpenning a bit far, but it doesn't invalidate my demonstration, does it?

I have to agree that the thumbnails are suggestively enhanced although I also agree that you pushed the sharpening way beyond the reasonable. What parameters did you pass to imagemagick ?

As a side note to anyone going to use unsharp mask in Imagemagick, the parameters are not the same as in Gimp. Gimp takes parameters such as :

    Radius : 6.0
    Amount : 0.5
    Threshold : 0

whereas Imagemagick will take something such as :
-unsharp 6x3+1+0

The explanation of the difference lies in the Gimp's changelog :
--- 0.8 --- 1999/07/02
- Radius parameter changed to refer to the standard deviation instead
of the radius of effect. The radius of effect is 2*std_dev.

But I have not yet managed to find an exact conversion from Gimp parameters to Imagemagick parameters.[/]

 
camelreef

Joined: 2003-08-10
Posts: 13
Posted: Wed, 2004-08-25 14:45
jiml wrote:
What parameters did you pass to imagemagick ?

Sorry, I used Photoshop, and as I pushed the envelope a bit, I didn't bother remembering...

Nico
http://rdo.homelinux.org/

 
Terje-
Terje-'s picture

Joined: 2004-01-20
Posts: 90
Posted: Thu, 2004-08-26 09:35

I think the "problem" is how Graphics kit resize the images to make thumbnails.
The answer is not to create a USM feature in Gallery, but rahter bug the Graphics kit makers (e.g Imagemagic) to utilize a different approach to how they resize images. I think that all images that are resized downwards (resolution), should be used with bicubic algorythm, with a sharpen effect. Must like what the Photoshop CS has implemented, it not only makes the images more sharp, but they stand out more real. The resize feature in IM, etc is not good, and if we all bug the developers enough they might look into the matter..

My 0.02 cents :-)

 
Haplo
Haplo's picture

Joined: 2004-03-29
Posts: 82
Posted: Wed, 2004-09-22 19:38

ANY unsharp mask behaviour would be really cool

as is i have to make a Adobe imageready patch for unsharping all GD generated thumbs manually