Home · Register · Join Upload & Sell

Moderated by: Fred Miranda
Username  

  New fredmiranda.com Mobile Site
  New Feature: SMS Notification alert
  New Feature: Buy & Sell Watchlist
  

FM Forums | Leica & Alternative Gear | Join Upload & Sell

1      
2
       3       end
  

Archive 2012 · Sharpening for non-PS users

  
 
m-a-x
Offline
• •
Upload & Sell: Off
p.2 #1 · p.2 #1 · Sharpening for non-PS users


This looks great!

I'd like that, too, but I am unable to understand how to instal Image Magick on a Macbook (MacPorts, Sudo, etc -> ).
I am also not aware how to establish a script.

Is it reasonable to kindly ask for your support or is it too extensive to begin with? Thx!



Apr 10, 2012 at 02:41 PM
Samuli Vahonen
Offline
• • • •
Upload & Sell: Off
p.2 #2 · p.2 #2 · Sharpening for non-PS users


m-a-x wrote:
This looks great!

I'd like that, too, but I am unable to understand how to instal Image Magick on a Macbook (MacPorts, Sudo, etc -> ).
I am also not aware how to establish a script.

Is it reasonable to kindly ask for your support or is it too extensive to begin with? Thx!

My nerves were not good enough.... so I'm using Linux on VMware Fusion. I tried 5 minutes, and didn't get it working (I don't want to install Xcode, my system disk is quite full since it's small SD-disk). Installing VMware and Linux image to it took less than 5 minuts, highly recommended. I'm not exactly sure why ImageMagick guys have made it so difficult, maybe they don't want it to used in Macs...

If you have hard drive space in system disk, then Macports is very easy, just install Xcode first. Then installing ImageMagick with Macports is really easy.



Apr 10, 2012 at 02:49 PM
Samuli Vahonen
Offline
• • • •
Upload & Sell: Off
p.2 #3 · p.2 #3 · Sharpening for non-PS users


FYI if you process a lots of human made artificial structures, you may not like step sharpening method listed above (or any step sharpening method...). Sometimes when some pattern happens to have correct frequency, photos will get moire or similar error due to this step sharpening.

Example:


Link to 975px high and full size (2.5MB) image.

This is just warning, in practice this rarely causes issues, for me almost never since I shoot >95% nature - I would never recommend to process all photos the same way, for example photos shoot with higher ISO need different sharpening.



Apr 10, 2012 at 03:25 PM
ukkisavosta
Offline
• •
Upload & Sell: Off
p.2 #4 · p.2 #4 · Sharpening for non-PS users


m-a-x,

A script is basically just a text file with a .sh file extension. You can copy the script text kindly provided above by Samuli into an empty file in a text editor and save it as a text file. Please note that you need to create separate scripts for landscape photos and portrait photos: use the appropriate part of the above script for each type. (At least I assumed that this is required, as the scripts appear not to be able to distinguish between the long edge and short edge of the image file).

Remember to replace the path to the files with the correct one you are using and to replace ".tiff" with ".tif" if you are using LR to export the TIFF files. Also, I don't know if this applies to Mac computers, but I also had to remove the CR/LF character from the end of each line, as I created the scripts using Windows Notepad.

Based on testing, the sharpening parameters chosen by Samuli require that the lens used is sharp to begin with. The scripts won't work well with a soft lens or image, but they really shine when the base TIFF image is sharp. I can't resist posting some further examples of how well these scripts work.









Apr 10, 2012 at 03:40 PM
rioni
Offline
• • •
Upload & Sell: Off
p.2 #5 · p.2 #5 · Sharpening for non-PS users


No problems getting this installed on Mac (Lion) although I have it running in Linux now. Shoot me a pm if you need any help with the OSX install max. I've found the sharpening is great for many shots but usually overkill with people shots. Any recommendations on tweaks to make for non-landscape/people shots Samuli?

Also, here are a few that I've processed with your script:







Apr 10, 2012 at 03:44 PM
m-a-x
Offline
• •
Upload & Sell: Off
p.2 #6 · p.2 #6 · Sharpening for non-PS users


Samuli, Jaakko, Rioni, thank you!

I have plenty of harddrive.
Next weekend, I will install everything as Samuli wrote and ask one of you again if it doesn't work ;-)
Looking forward! These images are really looking good!



Apr 10, 2012 at 04:46 PM
Samuli Vahonen
Offline
• • • •
Upload & Sell: Off
p.2 #7 · p.2 #7 · Sharpening for non-PS users


ukkisavosta wrote:
I just need to fix the icc profile. My files are stored on a LAN file server that runs on Ubuntu, so ImageMagick and exiftools were fairly easy to implement in the workflow.

The part of the script "...convert tif:- -profile sRGB.icc tif:-..." is converting from whatever profile you had before to sRGB. This is of course assuming you have copied sRGB.icc from ImageMagick installation folders to your current directory (or add full path to script). I don't know what happens if your source image isn't color managed, I have never tried non-color managed workflow, way too scary stuff for me...


ukkisavosta wrote:
Please note that you need to create separate scripts for landscape photos and portrait photos: use the appropriate part of the above script for each type. (At least I assumed that this is required, as the scripts appear not to be able to distinguish between the long edge and short edge of the image file).

I use 975px max wide/height photos, due to this I can let the script convert 975px wide and 975px height image. When I post it to forum, I show other and link to other as larger image (example). If you need just one size photos, then I would use ^-operator in resize, see this. Alternatively you can use 'identify' command and Unix/Linux command line tools (e.g. sed) to read image dimensions to variables, and then compare variables, and based on comparison run different scripts. Possibilities are endless...


ukkisavosta wrote:
Based on testing, the sharpening parameters chosen by Samuli require that the lens used is sharp to begin with. The scripts won't work well with a soft lens or image, but they really shine when the base TIFF image is sharp. I can't resist posting some further examples of how well these scripts work.

All the work I have done over the years with this method is because of ONE REASON: to preserve the small details I see in big images on my prints and 2560x1600 monitor on the websize images. Other methods typically when you "more sharpening" they just enhance the edges more and create halos, with soft images, this may work better. Generally if you have soft lenses with weak microcontrast, I would advice to search methods for edge sharpening...you can't find detail what is not there. However there are some things you can do (don't know any other tool than PhotoShop how to do it, most probably ImageMagick has ways to do that as well) is to increase the detail size, what is sharpened e.g. in PhotoShop instead of the filters -> sharpen -> sharpen use filters -> sharpen -> USM with large pixel size (e.g. 1.5px) between the steps. This typically causes artifacts and you have to radically adjust the pixel size in steps to mitigate.

EDIT: forgot to mention (sorry it's late...) reason 2: to preserve the DOF of larger photo. While most of the traditional methods loose the small textures, they ALSO sharpen the DOF, making it look even larger it was. On my "style" I use DOF for subject separation and for other purposes most of the time - I have very rarely images, in which everything is sharp. END OF EDIT


rioni wrote:
I've found the sharpening is great for many shots but usually overkill with people shots. Any recommendations on tweaks to make for non-landscape/people shots Samuli?

If you want to soften the effect of step sharpening, there are 4 ways to do it (naturally do opposite to get more sharpness and artifacts):
1 reduce the number of "steps"
2 reduce the amount sharpening between steps
3 adjust spacing of steps so that you have smaller steps in beginning and bigger steps in end (e.g. instead of full -> 4500px -> 2150px -> 975px do for example 4500px -> 3500px -> 975px)
4 remove the initial sharpening done on fullsized image

PS. Playing with 2 & 3 you can affect to which "size" detail gets the most sharpening.


With people shots I would not use at all the step sharpening method, but instead the dull normal method where you sharpen at last step in final size. This is if you want smooth faces. The idea of step sharpening is to preserve the textures, while most portrait shooters, don't want the textures, but instead want sharp edges. Of course step sharpening method is very effective for characteristic male models, if you want to emphasize their roughness.



Like I have tried to say; there will never single optimal method for every single photo. In PhotoShop I have 40+ scripts, which all end up creating 975px final image (they are different versions made in past years, not 40+ separate scripts each made for specific purpose. And I have absolute no clue what each of them does without trying...sure I get rough idea by looking at the PhotoShop script, but you never really know before trying).

This is most probably also reason, why any of the readymade software doesn't do step sharpening, but instead they use safe method, which makes all photos look average (e.g. Aperture & Lightroom methods to output web images). They cannot risk that stupid users would not adjust the sharpening properly and getting repuration "Lightroom has sharpening artefacts", just because idiot users don't know what they are doing ---> so better make everybody's images look dull and average.



Apr 10, 2012 at 04:51 PM
ukkisavosta
Offline
• •
Upload & Sell: Off
p.2 #8 · p.2 #8 · Sharpening for non-PS users


Samuli Vahonen wrote:
The part of the script "...convert tif:- -profile sRGB.icc tif:-..." is converting from whatever profile you had before to sRGB. This is of course assuming you have copied sRGB.icc from ImageMagick installation folders to your current directory (or add full path to script). I don't know what happens if your source image isn't color managed, I have never tried non-color managed workflow, way too scary stuff for me...


A quick search did not reveal the path to the profile file, but I need to search again. My images are very gung-ho at the moment, and my monitor isn't properly calibrated either (I've only performed a coarse calibration by eye using a calibration chart), so I'm pretty much living dangerously as far as colors are concerned.

I hope you do not see my usage of the script as gross misuse of a fine instrument.



I use 975px max wide/height photos, due to this I can let the script convert 975px wide and 975px height image. When I post it to forum, I show other and link to other as larger image (example). If you need just one size photos, then I would use ^-operator in resize, see this. Alternatively you can use 'identify' command and Unix/Linux command line tools (e.g. sed) to read image dimensions to variables, and then compare variables, and based on comparison run different scripts. Possibilities are endless...


Ah, I seem to have misunderstood the original usage of the script: It is not even meant to discern between landscape and portrait, but only produce two different versions of the image, regardless of orientation. The preview image used (wide or tall) then depends on the orientation of the original image.



All the work I have done over the years with this method is because of ONE REASON: to preserve the small details I see in big images on my prints and 2560x1600 monitor on the websize images. Other methods typically when you "more sharpening" they just enhance the edges more and create halos, with soft images, this may work better. Generally if you have soft lenses with weak microcontrast, I would advice to search methods for edge sharpening...you can't find detail what is not there. However there are some things you can do (don't know any other tool than PhotoShop how
...Show more

Yes, I have understood from the descriptions that there is no universal "silver bullet" script, and some experimentation is required to get the most out of any given photo (even the sharp ones). A completely different workflow is required for the softer images, and there's no getting around the fact of "garbage in -> garbage out".

Anyway, I am very happy with the general results this script provides, but more demanding users will probably be able to fine-tune the script for each individual image.


EDIT: forgot to mention (sorry it's late...) reason 2: to preserve the DOF of larger photo. While most of the traditional methods loose the small textures, they ALSO sharpen the DOF, making it look even larger it was. On my "style" I use DOF for subject separation and for other purposes most of the time - I have very rarely images, in which everything is sharp. END OF EDIT


It is apparent in the converted images, that the script only brings out the details within the DOF and does not touch the OOF parts. Provided that there is detail to begin with within the DOF.

The idea of step sharpening is to preserve the textures, while most portrait shooters, don't want the textures, but instead want sharp edges.

I think this is a very good point, and it sums up this method very well.


Like I have tried to say; there will never single optimal method for every single photo. In PhotoShop I have 40+ scripts, which all end up creating 975px final image (they are different versions made in past years, not 40+ separate scripts each made for specific purpose. And I have absolute no clue what each of them does without trying...sure I get rough idea by looking at the PhotoShop script, but you never really know before trying).

This is most probably also reason, why any of the readymade software doesn't do step sharpening, but instead they use safe method, which makes
...Show more

Having just found out the power of step sharpening, it still makes me wonder why it is not provided as another option to use in LR et al. Professionals use Aperture and Lightroom, and surely they must also use web preview images to promote their work and show to the customers. One would think that if the option of step sharpening was provided, the pros would quickly realize the power (and also the limitations) of this method.

Jaakko



Apr 11, 2012 at 03:43 AM
m-a-x
Offline
• •
Upload & Sell: Off
p.2 #9 · p.2 #9 · Sharpening for non-PS users


Hello Samuli, hello Jaakko,

I managed to install all three software packages. It was not easy for me but it seems to be a success, at least I got no negative message. Now I am struggling with the script.

a) where in SAMULI's script is the path that I have to adjust
b) I renamed the textfile to *.sh but when I double-klick it, it still opens in the text editor. I assume this is not what is intended?

Sorry for bothering you with that but this is clearly not my area of expertise. In fact, I am surprised how complicated this is...
Thanks in advance!



Apr 18, 2012 at 05:07 PM
Samuli Vahonen
Offline
• • • •
Upload & Sell: Off
p.2 #10 · p.2 #10 · Sharpening for non-PS users


m-a-x,

a) The red part needs to point where you have sRGB.icc, or just copy sRGB.icc to directory in which you execute the script.
convert photo.tiff -level 19%,90%,1 -sharpen 1x50+0 tif:- | convert tif:- -interpolate bicubic -resize '4500' tif:- | convert tif:- -sharpen 0.6x25+0 tif:- | convert tif:- -interpolate bicubic -resize '2150' tif:- | convert tif:- -sharpen 0.2x5+0 tif:- | convert tif:- -interpolate bicubic -resize '975' tif:- | convert tif:- -profile sRGB.icc tif:- | convert tif:- -quality 87 photo.jpg

b) double-click? hmmm, based on this I would assume you are using Windows (Linux people typically understand to go to command line and execute scripts from there) so use suffix ".bat", however I don't know does "|" operator work in MS DOS. If it doesn't you need to output each step to tiff-file in hard drive instead of using standard output (and input). To replace standard output replace "tif:-" with name of tiff-file you want to save. To replace standard input replace from beginning of command (just after "convert") "tif:-" with the tiff-file you want to process with convert command.

Samuli



Apr 18, 2012 at 05:22 PM
m-a-x
Offline
• •
Upload & Sell: Off
p.2 #11 · p.2 #11 · Sharpening for non-PS users


Thanks for this quick answer! I am using OSX 10.6.
No double-click required?
Does that mean as soon as tiff's are exported from LR into the specific folder - where the script and the icc file are located - the pictures get "automatically" resized+sharpened+converted?
(I did not try this so far but I assumed the *.sh file should not open in text editor any more... )



Apr 18, 2012 at 05:43 PM
Samuli Vahonen
Offline
• • • •
Upload & Sell: Off
p.2 #12 · p.2 #12 · Sharpening for non-PS users


M-a-x, ok OS X. I'm old Unix admin so I'm at home on Terminal, I have never even tried to execute scripts from Finder. In terminal I just go to directory where script is and then type ./scriptname.sh

I don't know a way to execute them directly from Finder.



Apr 18, 2012 at 05:51 PM
ukkisavosta
Offline
• •
Upload & Sell: Off
p.2 #13 · p.2 #13 · Sharpening for non-PS users


m-a-x wrote:
a) where in SAMULI's script is the path that I have to adjust


m-a-x,

This might appear overwhelming, so please consider that Samuli has a Unix admin background (which I kind of gathered from the graceful ease in his description of the setup), whereas I have a very limited knowledge of Linux and command line operated systems - barely enough to even run a personal Linux box. This is a case of "when you start learning the basics, you begin to appreciate just how little you actually know". If you have the interest and time, it can be very rewarding, but on the other hand, if you only want to apply the step sharpening method to your images, it might be easier and less of a pain to just create an action in Photoshop/GIMP.

Anyway, Samuli described the path concerning the icc file (which I personally am having trouble locating within imagemagick's files - I think I just need to source it elsewhere), but you also need to adjust the path pointing to where the tiff images are located:

# First defining which files to process
FILES=/mnt/hgfs/RAWtest/*.tiff

This is a Unix/Linux filesystem path. I'm not sure about your system, but basically you either need to mount the OS X folder that holds the tiff photos within Linux, or copy/move the tiff files to a location that is already mounted within Linux. For example, my path looks like this: /media/Files/Photos/resize/*.tif

b) I renamed the textfile to *.sh but when I double-klick it, it still opens in the text editor. I assume this is not what is intended?

The script needs to be launched from Linux, but it appears that you are trying to launch it from Mac OS. I believe you have a virtual machine set up on your Mac computer (I didn't pay attention to this step in Samuli's instructions, as I have a separate Linux machine, so it doesn't concern my setup). What you would need to do is launch the virtual machine, log into Linux, open the correct folder in Linux, make the script executable (I forgot the command) and then execute it. You will then get feedback, e.g. "1 image file processed".


Sorry for bothering you with that but this is clearly not my area of expertise. In fact, I am surprised how complicated this is...
Thanks in advance!


No problem, and it is true that this method does require at least a basic knowledge of Linux, which might be somewhat of a hurdle.

Jaakko



Apr 19, 2012 at 02:19 AM
Samuli Vahonen
Offline
• • • •
Upload & Sell: Off
p.2 #14 · p.2 #14 · Sharpening for non-PS users


ukkisavosta wrote:
If you have the interest and time, it can be very rewarding, but on the other hand, if you only want to apply the step sharpening method to your images, it might be easier and less of a pain to just create an action in Photoshop/GIMP.

+1 (thou time is only needed for the initial effort, then it just saves time and effort)

I'll try to find time to install GIMP (it maybe is already installed to my Kubuntu virtual machine) and create instructions how to do same thing with GIMP.


For me personally all things with computer are "nice to invent/develop/create some process, nice to standardize and industrialize the process, but no way I'll start doing frequently some process". Due to this I really hate all PP I need to do to my photos, but it's nice to create some script (manual or automated) but I would loose my mind if I would have to post process 100 pictures doing same actions all of them manually. Due to this usage of tools like GIMP is out of the question for me personally, assuming it doesn't have efficient scripting interface (don't know ICC support either).

On my own workflow from CF card to final published image I have automated everything what is possible. I spent most of the time adjusting images and for 90% of images I never don't touch anything but black level, for the more laborious 10% of images half need also white balance adjustments and then rest may need highlight restoration and highlights slider (sometimes I drop saturation few clicks) - I target to keep the active time I actually do something for normal images under 10s/image. Thou I have quite big challenges due to GPS coordinate tagging, since I have not been able to fully automate it (loading .gpx file, adding it to folder in Aperture and assigning to images) and many steps currently are manual taking tens of seconds for each folder, making average 10s/image impossible unless I have tens of photos in folder.

Samuli



Apr 19, 2012 at 03:39 AM
Samuli Vahonen
Offline
• • • •
Upload & Sell: Off
p.2 #15 · p.2 #15 · Sharpening for non-PS users


I tried to do it with GIMP, but I was not able to create script, which would maintain high enough quality due to GIMP not supporting 16-bit images. If somebody tries to make script I would advice at least following:
- export TIFF in sRGB (in 8-bit mode it just kills image to convert from color space to another)
- try to create script with as small number of steps as possible, all extra interpolations on 8-bit data degrade overall image quality



Apr 19, 2012 at 01:53 PM
m-a-x
Offline
• •
Upload & Sell: Off
p.2 #16 · p.2 #16 · Sharpening for non-PS users


Dear Samuli, Jaakko, Rioni, thank you for your explanations.
However, I give up. There's too much for me to learn, it's too much effort.
I will give it a try to make a droplet in PS or something similar and hope that the results will be tending towards what I have seen here. Great work, I admire your innovative approach!




Apr 19, 2012 at 04:12 PM
ukkisavosta
Offline
• •
Upload & Sell: Off
p.2 #17 · p.2 #17 · Sharpening for non-PS users


m-a-x,

Yes, I think you will save yourself from unnecessary headaches by going that route. And you will most likely get comparable results with any software, if you follow the basic principle described by Samuli, so you won't really miss out on anything.



Apr 20, 2012 at 05:55 AM
m-a-x
Offline
• •
Upload & Sell: Off
p.2 #18 · p.2 #18 · Sharpening for non-PS users


Samuli, Jaakko and Rioni,
it did not work out for me with such a script but you inspired me to create a 3-step size reduction and sharpening droplet in PS. The nice thing is, this droplet can be combined with an export pre-set in LR. That means with a "normal" LR export I get what I want without any manual step extra!
The sequence of things looks like this:
1) Doing in LR whatever I want, only not excessive sharpening.
2) LR export using a pre-set (as a tiff, and the file is associated with the PS droplet)
3) it opens itself in PS where it receives 2x STANDARD SHARPEN, then:
4) img width 2000px
5) unsharp mask 150/0.5
6) img width 1350px
7) smart sharpen 77/0.3
8) img width 1280px
9) save as jpg and close

Not sure if something can be optimized; I tried different settings but the results did not get better.
In fact I am quite happy with the majority of the tests I made. Definitely a step forward from LR only.
Here are some examples - alt and not so alt. They are not brand-new, but brand-new-processed!
Thanx once more for the inspiration!


Ireland by meizzner, on Flickr



Ireland by meizzner, on Flickr


Ubahnen in München by meizzner, on Flickr


Ubahnen in München by meizzner, on Flickr


Diamaltwerke, München by meizzner, on Flickr


Diamaltwerke, München by meizzner, on Flickr



May 03, 2012 at 03:25 PM
m-a-x
Offline
• •
Upload & Sell: Off
p.2 #19 · p.2 #19 · Sharpening for non-PS users


And thanks to Mawz for starting this thread!


May 03, 2012 at 03:31 PM
ukkisavosta
Offline
• •
Upload & Sell: Off
p.2 #20 · p.2 #20 · Sharpening for non-PS users


m-a-x,

The results look absolutely great. I especially like your second U-bahn shot. Congratulations!

Jaakko



May 03, 2012 at 04:19 PM
1      
2
       3       end




FM Forums | Leica & Alternative Gear | Join Upload & Sell

1      
2
       3       end
    
 

You are not logged in. Login or Register

Username       Or Reset password



This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.