Implement This Filter
-
- Posts: 16
- Joined: 2013-11-02T06:35:23-07:00
- Authentication code: 6789
Implement This Filter
While browsing through the web, I came across this image, and I'm wondering whether it can be implemented through ImageMagick. The first image is the original image, and the second image is the filtered image.
Re: Implement This Filter
You can tinker with -sepia-tone and -gamma.
comes fairly close to your objective, but looks a little warmer. You also
seem to have a slight "fog" effect which I did not try to reproduce.
Code: Select all
convert photoshop*.jpg -sepia-tone 80% -gamma 1.2,.5,.8 ...
comes fairly close to your objective, but looks a little warmer. You also
seem to have a slight "fog" effect which I did not try to reproduce.
-
- Posts: 16
- Joined: 2013-11-02T06:35:23-07:00
- Authentication code: 6789
Re: Implement This Filter
Thanks for your reply!
How to implement that fog effect ?
How to implement that fog effect ?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Implement This Filter
You may be able to achieve the fog effect by adding some white to the image and then adding a vignette effect.
see -colorize and -vignette
Also please identify your version of IM and platform.
see -colorize and -vignette
Also please identify your version of IM and platform.
Last edited by fmw42 on 2013-11-02T11:37:53-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Implement This Filter
If the OP provides the link to the original page, we might get a hint.
This is fairly close, but noticably wrong in the top-right highlights. Windows script:
This is fairly close, but noticably wrong in the top-right highlights. Windows script:
Code: Select all
%IM%convert effect.jpg ^
-channel R -level -73.91%%,81.91%% ^
-channel G -level -4%%,96%% ^
-channel B -level -78.58%%,213.08%% ^
+channel ^
e.jpg
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Implement This Filter
It is like the Toaster Effect from Instagram. The following Photoshop tutorial explains how to create it.
http://www.photoshoproadmap.com/video/yt/PmWE-FZOgyU/
It was effect 31 at http://designrfix.com/resources/33-amaz ... -tutorials
http://www.photoshoproadmap.com/video/yt/PmWE-FZOgyU/
It was effect 31 at http://designrfix.com/resources/33-amaz ... -tutorials
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Implement This Filter
The main fault with my attempt above is the lack of a vignette effect. I'll create a mask for a vignette. This is white in the centre, black in the corners, with equal values in the centre of each edge (thus has elliptical contours).
Then I use this mask twice, to reduce saturation and then lightness in the corners. The two levels give different fades.
I shouldn't use JPEG as an intermediate format, but it probably adds to the overall horrible degraded appearance.
Code: Select all
FOR /F "usebackq" %%L IN (`%IM%identify -format "WIDTH=%%w\nHEIGHT=%%h" e.jpg`) DO set %%L
FOR /F %%i ^
IN ('%IM%identify ^
-ping ^
-format "%%[fx:max(%WIDTH%,%HEIGHT%)]" ^
xc:') ^
DO set MAX=%%i
FOR /F %%i ^
IN ('%IM%identify ^
-ping ^
-format "%%[fx:int(%MAX%*sqrt(2)+0.5)]" ^
xc:') ^
DO set DIM=%%i
"%IM%convert" ^
-size %DIM%x%DIM% ^
radial-gradient: ^
-gravity Center -crop %MAX%x%MAX%+0+0 +repage ^
-resize "%WIDTH%x%HEIGHT%^!" ^
vig_mask.png
Code: Select all
"%IM%convert" ^
e.jpg ^
( -clone 0 -modulate 100,0,100 ) ^
( vig_mask.png -negate -level 50%%,95%% ) ^
-composite ^
( -clone 0 -modulate 90,100,100 ) ^
( vig_mask.png -negate -level 60%%,100%% ) ^
-composite ^
e2.png
snibgo's IM pages: im.snibgo.com
-
- Posts: 16
- Joined: 2013-11-02T06:35:23-07:00
- Authentication code: 6789
Re: Implement This Filter
My IM version is 6.8.7-0 and I'm running it on Windows (will the same code produce a different effect in Linux or other OS ?)fmw42 wrote:Also please identify your version of IM and platform.
I see that fmw42 has already posted the link. Thankssnibgo wrote:If the OP provides the link to the original page, we might get a hint.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Implement This Filter
No, but almost. There are some syntax differences between IM on Windows and IM on Unix (Linux, Mac)johnthomas1433 wrote: My IM version is 6.8.7-0 and I'm running it on Windows (will the same code produce a different effect in Linux or other OS ?)
See http://www.imagemagick.org/Usage/windows/
The code provided above by snibgo is for Windows.
-
- Posts: 16
- Joined: 2013-11-02T06:35:23-07:00
- Authentication code: 6789
Re: Implement This Filter
johnthomas1433 wrote:My IM version is 6.8.7-0 and I'm running it on Windows (will the same code produce a different effect in Linux or other OS ?)fmw42 wrote:Also please identify your version of IM and platform.
I see that fmw42 has already posted the link. Thankssnibgo wrote:If the OP provides the link to the original page, we might get a hint.
That is pretty close! But like you have said, it does lack a vignette effect.snibgo wrote:This is fairly close, but noticably wrong in the top-right highlights. Windows script:Code: Select all
%IM%convert effect.jpg ^ -channel R -level -73.91%%,81.91%% ^ -channel G -level -4%%,96%% ^ -channel B -level -78.58%%,213.08%% ^ +channel ^ e.jpg
Thanks for the link! I'm using it now on Windows, but I may have to use it later on a Linux system.fmw42 wrote:No, but almost. There are some syntax differences between IM on Windows and IM on Unix (Linux, Mac)
See http://www.imagemagick.org/Usage/windows/
The code provided above by snibgo is for Windows.
-
- Posts: 16
- Joined: 2013-11-02T06:35:23-07:00
- Authentication code: 6789
Re: Implement This Filter
You have lost me here, as I'm a newbie to Imagemagick. Can you kindly explain how you implemented the vignette effect? Wont -vignette command work here ?snibgo wrote:I'll create a mask for a vignette. This is white in the centre, black in the corners, with equal values in the centre of each edge (thus has elliptical contours).Then I use this mask twice, to reduce saturation and then lightness in the corners. The two levels give different fades.Code: Select all
FOR /F "usebackq" %%L IN (`%IM%identify -format "WIDTH=%%w\nHEIGHT=%%h" e.jpg`) DO set %%L FOR /F %%i ^ IN ('%IM%identify ^ -ping ^ -format "%%[fx:max(%WIDTH%,%HEIGHT%)]" ^ xc:') ^ DO set MAX=%%i FOR /F %%i ^ IN ('%IM%identify ^ -ping ^ -format "%%[fx:int(%MAX%*sqrt(2)+0.5)]" ^ xc:') ^ DO set DIM=%%i "%IM%convert" ^ -size %DIM%x%DIM% ^ radial-gradient: ^ -gravity Center -crop %MAX%x%MAX%+0+0 +repage ^ -resize "%WIDTH%x%HEIGHT%^!" ^ vig_mask.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Implement This Filter
The same IM commands should produce identical results on any platform. My commands above use Windows "FOR". Unix works differently.
If you run my commands and look at vig_mask.png, you should see it is as I described. My final convert does two operations:
1. Makes a copy of e.jpg with zero-saturation (ie monochrome), and compose it over e.jpg, but only at the edges.
2. Makes another copy of e.jpg, but slightly darker, and compose this over the previous result, but only at the edges.
You could do it with "-vignette" instead. My version gives greater control over the width and placement of the transition between the original and the two copies.
If you run my commands and look at vig_mask.png, you should see it is as I described. My final convert does two operations:
1. Makes a copy of e.jpg with zero-saturation (ie monochrome), and compose it over e.jpg, but only at the edges.
2. Makes another copy of e.jpg, but slightly darker, and compose this over the previous result, but only at the edges.
You could do it with "-vignette" instead. My version gives greater control over the width and placement of the transition between the original and the two copies.
snibgo's IM pages: im.snibgo.com
-
- Posts: 16
- Joined: 2013-11-02T06:35:23-07:00
- Authentication code: 6789
Re: Implement This Filter
When I try the first line of your code in the command prompt
I'm getting the error as
What am I doing wrong ?
Code: Select all
FOR /F "usebackq" %%L IN (`%IM%identify -format "WIDTH=%%w\nHEIGHT=%%h" e.jpg`) DO set %%L
Code: Select all
%%L was unexpected at this time
-
- Posts: 16
- Joined: 2013-11-02T06:35:23-07:00
- Authentication code: 6789
Re: Implement This Filter
My bad. Didnt see it as a bash scriptjohnthomas1433 wrote:When I try the first line of your code in the command promptI'm getting the error asCode: Select all
FOR /F "usebackq" %%L IN (`%IM%identify -format "WIDTH=%%w\nHEIGHT=%%h" e.jpg`) DO set %%L
What am I doing wrong ?Code: Select all
%%L was unexpected at this time
-
- Posts: 16
- Joined: 2013-11-02T06:35:23-07:00
- Authentication code: 6789