Few questions (Night Lights of Town)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Few questions (Night Lights of Town)

Post by VanGog »

Update - example photo:
http://upload.wikimedia.org/wikipedia/c ... 007%29.jpg


Ad 5) Night light (night photo of town or city)
This is first layer:
I got an idea so I paste here image made in Photoshop

http://i46.tinypic.com/14mxfn5.jpg

1) I did this by Image/Adjustment/Exposure (unknown value of ) exposure, offset 0, gamma 1
Then taken Image/Adjustment/Photo Filter - Warm filter (orange 35% or 45%) applied at least 4x
http://www.photoshopessentials.com/imag ... ter-85.gif

This is night light from lights.

For next layer, I could take original or first layer and apply -8,00 exposure (getting very much dark only very poor silhouettes of streets or houses are visible).

Then I must to add the mask to this layer. The steps to made mask are more complicated...

My question here is how to make this effects in IM?


Image
Last edited by VanGog on 2014-06-10T10:02:11-07:00, edited 2 times in total.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Few questions (Night Lights of Town)

Post by anthony »

That depend on exactly what the warming filter does. Not everyone is a Photoshop user. I don't!

This topic was split from original topic...
viewtopic.php?f=1&t=21048
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Few questions (Night Lights of Town)

Post by fmw42 »

Please post the input image. We cannot even try to guess what to tell you without trying experiments using the same input image.

Also as Anthony says, we do not know what the warming filter 85 does. It is hard to know just from a picture. One would have to have the input image, put it in PS and see what is actually happening and then try to find some way to do the same in IM. But this is trial and error to figure out what PS is doing and then more trial and error to try to duplicate it in IM.
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: Few questions (Night Lights of Town)

Post by VanGog »

I tried to imitate yesterday's night try, but this try was not so good as the example published here. Probably the basic thing is to use exposure, but not too much. You need still some light for the warming filter. What exactly Warming filter is, I did not find out. I only know it probably looks similar to orange overlay or orange soft light of 80%, but it is not identical. Maybe I just selected incorrect orange and should be more red or more yellow.

Here are my files:
http://ulozto.cz/x4yFP9G/night-map-zip

After you click on "Stahnout" (Download), there is captcha on the second column,
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Few questions (Night Lights of Town)

Post by fmw42 »

It would have been better if you had provided the very same image as your example above.

Nevertheless, looking at the warmingfilter 85 in PS, I can make IM produce nearly the same thing using


convert \( original.jpg -level 0x100% \) \
\( -size 617x588 xc:"#E48B00" -alpha set -channel o -evaluate set 100% +channel \) \
-compose multiply -composite original_lights.jpg

The -level 100% will adjust your exposure, by changing the 100% and can make the image darker by changing the 0%. The density from the PS filter (with preserve luminosity disabled) can be controlled by -evaluate set 100%. Lower the 100% to 0 and you get no filter applied as in PS. I measure the color swatch in PS and got slightly different hex value than you, but not enough to make much difference.
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: Few questions (Night Lights of Town)

Post by VanGog »

Before I will try your command I send the original file as that one from one I have did the first test.

http://ulozto.cz/xhhgLAv/original-jpg
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Detailed description with images 99% success

Post by VanGog »

Thank you.

In the package I have uploaded more files.

The best product was "final product - exposure 1 + warming 45+45+35+35 + exposure 3.jpg"

"photo filter - warming 79.jpg" - this file was just the first try that I did. I see it not good, because it is too light - but this is not problem, it can be darken later. Problem is the orange overlay

I think it is not the way.

Your configuration is not good, so I would prefer similar way:
1) exposure -0.33, not offset change
2) Warming filter 75% default orange
3) exposure -0.33, not offset change
4) Warming filter 75% #eca700 (I liked to try more yellow) or default #ec8a00
5) exposure +0,07 (little more lights) and -0,012 (little more dark)

I include the images here:
http://ulozto.cz/xoa6e2d/test5-zip

But I hope you can help me to configure it - could it be at 5 layers? It is better to work with just little exposure changes and to overlay it with orange at 75% of default color or rather more red.

And one image for inspiration:
http://upload.wikimedia.org/wikipedia/c ... 007%29.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Few questions (Night Lights of Town)

Post by fmw42 »

This is about as close as I can get:


convert \( original_.jpg -level 0x85% -modulate 100,90,100 \) \
\( -size 806x614 xc:"#E48B00" -alpha set -channel o -evaluate set 92% +channel \) \
-compose multiply -composite original_lights.jpg

P.S. Rather than trying to come up with some set of commands in IM to match what you do in PS, you can create a hald image, process it just like you do in PS, then apply it to any image in IM using convert image hald_image -hald-clut result.

see
http://www.imagemagick.org/Usage/color_mods/#hald-clut
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: Few questions (Night Lights of Town)

Post by VanGog »

I am not sure if I understand the example.

convert original_.jpg lights_sample.jpg -hald-clut lights.jpg
Does not generate any file.

convert original_.jpg hald_3.png -hald-clut lights.jpg
resizes the file...

------------------------------------------------------------

Code: Select all

convert ( original_.jpg -level 5x90%% ) ^
( -size 806x614 xc:"#E48B00" -alpha set -channel o -evaluate set 30%% +channel ) ^
-compose multiply -composite lights_01.jpg

convert ( lights_01.jpg -level 5x90%% ) ^
( -size 806x614 xc:"#E48B00" -alpha set -channel o -evaluate set 30%% +channel ) ^
-compose multiply -composite lights_02.jpg
I did not succeed to emulate exactly same exposition, nor the warming filter. The overlay is really like you would spill a tin of paint on a canvas. Something terrible. If you will set just 25% effectiveness (opacity/transparency) and repeat it twice or three times, it is like opaque, simply the original image damaged or lost - sorry for lack of words. The warming filter works differently. It only changes tone of the colors. So you can apply more times at 1/4 or 1/3

Yet I made a video showing how Warming filter works. With photos. You can see it only changes tones (or hues) to orange and then to red. Interesting is to watch channels. red channel has lost of contrast, blue channel has the most of contrast.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Few questions (Night Lights of Town)

Post by fmw42 »

First you have to create a hald image in IM. Do NOT save it as jpg as that corrupts the data due to compression losses. Save as png. Then take that png hald image and process it in your PS (or whatever tool you use). Then bring the processed hald image back to IM and run the command

convert originalimage processedhaldimage -hald-clut processedoriginalimage

Not the hald processing only works for point image processing. It will not work with any geometrical processing such as blurring, sharpening, distortions.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Few questions (Night Lights of Town)

Post by anthony »

The point of HALD images (or other Color Lookup Tables) is to save global color modifications in a 'universal' and 'fast' form that can be used for any general color modification.

See "Color Lookup Tables" for introduction
http://www.imagemagick.org/Usage/color/ ... #color_lut
and HALD CLUT's specifically.
http://www.imagemagick.org/Usage/color_mods/#hald-clut
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: Few questions (Night Lights of Town)

Post by VanGog »

fmw42 wrote:First you have to create a hald image in IM. Do NOT save it as jpg as that corrupts the data due to compression losses. Save as png. Then take that png hald image and process it in your PS (or whatever tool you use). Then bring the processed hald image back to IM and run the command
That is what I tried first and it resized the image to size of hald image.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Few questions (Night Lights of Town)

Post by anthony »

You create and SAVE the HALD image. But for the -hald operator, the hald image itself must be the second image, to modify the first (primary) image.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: Few questions (Night Lights of Town)

Post by VanGog »

Well that are good news :-) I succeed to do it (warm filter imitation). I don't know why it was not right for first time.

Thanks for it.

But still to finish this topic, it seems to me still a lot of things that I need to learn or find way how to do.

Now I would like to try to make the mask.

According originated topic:
fmw42 wrote:
VanGog wrote:I look for some functions.

1) How can I expand and contract "selection" (PS menu Selection/Modify/Expand or Contract) ... I mean I would like to select routes and streets from image (light white or light gray) and fill them with white color; the rest is black. So I would like to extend the white +3 and contract it back -3.
Not directly. What you can do is use -fuzz ... -floodfill at some pixel coordinates. Then convert the result to binary as a mask. Then blur the mask and threshold to make it bigger or smaller.
ImageMagick still does some steps so complicated. This step called expansion and/or contraction of the white pixels in mask, are very basic in Photoshop, because they are part of selection. In photoshop this simply widens or narrows the selection (white pixel area in IM). So it should be made fast. I am going to work with big images 4096x4096 and I think that this will take more time in IM.
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: Few questions (Night Lights of Town)

Post by VanGog »

I am going to do mask from the roads and streets.

Can you write syntax how to make multiple fills? As I would want to select more colors and to fill them white to create binary mask.
Post Reply