Page 1 of 3
Icon package stylization
Posted: 2019-01-03T14:55:10-07:00
by Hunter23071985
Hi!
The command for batch processing of PNG files in the IN-folder with saving to the OUT-folder in Windows (bat-file):
Code: Select all
cd /d "%~dp0"
for %%i in (in\*.png) do convert.exe -channel RGB -modulate 100,0 +level-colors rgb(100,100,100),rgb(170,170,170) -fuzz 5%% -trim -filter triangle -thumbnail 206x206 -extent 256x256 -gravity center -function polynomial 0.804,-0.00133 -evaluate max 5%% -evaluate min 90%% -background RGBA(255,71,1,0.75) -flatten -colorspace sRGB "%%~fi" "out\%%~nxi"
At the entrance: a variety of colors and shades, sizes and forms, faded and bright, all mixed up.
At the exit: uniform quiet color scale without sharp differences; identical size, form and overall design.
Viewing:
before -
after (different background to divide software and add colors). The source is
here.
The goal: remove the pure black, lighten the dark, darken the light, i.e. bring everything to a "common denominator."
In general, the goal is achieved. A gray icon on a semitransparent background doesn't hurt the eyes, but looks a little faded...
Alas, on this stage my imagination and knowledge of IM have ended...
Now I'd like to round the edges and smooth resize-artifacts. How to do it and what can be changed / improved in general?
Re: Icon package stylization
Posted: 2019-01-03T16:13:28-07:00
by snibgo
What version of IM? On Windows, I assume.
Hunter23071985 wrote:... what can be changed / improved in general?
Rearrange the convert command to be in the logical order: read the file, process it, then write it.
Hunter23071985 wrote:Now I'd like to round the edges and smooth resize-artifacts.
I'm unsure what you want. Sample images would help.
Re: Icon package stylization
Posted: 2019-01-03T16:24:27-07:00
by fmw42
Re: Icon package stylization
Posted: 2019-01-04T03:44:57-07:00
by Hunter23071985
snibgo, I use Windows 10.1709 x64 and ImageMagick-7.0.8-15-portable-Q16-x86.
This topic was created because I'm sure that there are many creative people on this forum.
ImageMagick has many functions, but I found this program a couple days ago.
I saw links offered by
fmw42 and many others too, but not all of them I can understand and use.
That's why I hope that someone offers something cool!
Now sample design for me:
iOS style icons (transparent rounded corners + overlay some sheen).
Maybe it would be interesting to convert icons into a pencil drawing or something else.
I converted 01.png into a "pencil sketch" 02.png and then combined it with 2 backgrounds, getting 03.png and 04.png.
You can download it
here. I think it looks good.
Could you rebuild the convert command and add this features to it?
Re: Icon package stylization
Posted: 2019-01-04T09:11:48-07:00
by Hunter23071985
Post updated. Hope for your help!
Re: Icon package stylization
Posted: 2019-01-04T11:12:38-07:00
by fmw42
I do not understand what you want. Are you asking to reproduce the pencil sketch. If so, Imagemagick does not have such a function that works the same way, though you might be able to make something similar by combining other commands. See
https://imagemagick.org/Usage/transform/#sketch
try
Code: Select all
convert 01.png -colorspace gray -emboss 0x1.2 01_pencil.png
Once you have that you can simply overlay it on your background images.
Code: Select all
convert "_ Background1.png" 01_pencil.png -gravity center -compose over -composite result.png
I suggest you not use image names with spaces in them.
If this is not what you want, please explain in more detail and/or show examples of what you want.
Re: Icon package stylization
Posted: 2019-01-04T12:21:43-07:00
by Hunter23071985
fmw42, thank you for combining icon and background - this is exactly what i wanted.
Remains to work out a pencil sketch - "emboss" looks bad, something else like "
Pencil Sketch" I cannot set up correctly...
Is it possible to achieve a good result?
Re: Icon package stylization
Posted: 2019-01-04T12:34:55-07:00
by fmw42
You should be able to simply replace your image for the one in Anthony's Pencil Sketch. Nevertheless, here it is along with the composite I showed you before.
Code: Select all
convert -size 256x256 xc: +noise Random -virtual-pixel tile \
-motion-blur 0x20+135 -charcoal 1 -resize 50% pencil_tile.gif
convert 01.png -colorspace gray \
\( +clone -tile pencil_tile.gif -draw "color 0,0 reset" \
+clone +swap -compose color_dodge -composite \) \
-fx 'u*.2+v*.8' 01_sketch.gif
convert "_ Background1.png" 01_sketch.gif -gravity center -compose over -composite result.png
Re: Icon package stylization
Posted: 2019-01-04T12:58:32-07:00
by Hunter23071985
fmw42, such result I already received - the whole icon with transparent part becomes a "sketch". It cannot be fixed?
And what is "Anthony's Pencil Sketch"?
Re: Icon package stylization
Posted: 2019-01-04T13:18:27-07:00
by fmw42
Sorry, I do not understand what you want fixed. Please give more details.
Anthony's pencil sketch is the link you provided above "Pencil Sketch"
Re: Icon package stylization
Posted: 2019-01-04T13:36:15-07:00
by Hunter23071985
fmw42, see the
results comparison...
Re: Icon package stylization
Posted: 2019-01-04T17:14:50-07:00
by fmw42
Try this
Code: Select all
convert -size 256x256 xc: +noise Random -virtual-pixel tile \
-motion-blur 0x20+135 -charcoal 1 -resize 50% pencil_tile.gif
convert 01.png -resize 500x500 -colorspace gray \
\( +clone -tile pencil_tile.gif -draw "color 0,0 reset" \
+clone +swap -compose hardlight -composite \) \
-fx 'u*.2+v*.8' 01_sketch1.gif
convert "_ Background1.png" 01_sketch1.gif -gravity center -compose over -composite result1.png
or
Code: Select all
convert -size 256x256 xc: +noise Random -virtual-pixel tile \
-motion-blur 0x20+135 -charcoal 1 -resize 50% pencil_tile.gif
convert 01.png -resize 500x500 -colorspace gray \
\( +clone -tile pencil_tile.gif -draw "color 0,0 reset" \
+clone +swap -compose bumpmap -composite \) \
-fx 'u*.2+v*.8' 01_sketch2.gif
convert "_ Background1.png" 01_sketch2.gif -gravity center -compose over -composite result2.png
You can substitute other -compose methods other than hardlight and bumpmap and see if you can find anything better. Let us know. See
https://imagemagick.org/Usage/compose/#math
https://imagemagick.org/Usage/compose/#light
Re: Icon package stylization
Posted: 2019-01-05T01:17:55-07:00
by Hunter23071985
Is there an error in the second variant?
Here's what I got...
I suppose
this method should help, but it is too complicated for me...
Re: Icon package stylization
Posted: 2019-01-05T11:02:21-07:00
by fmw42
The second variant for me produces something else. What is your IM version and data and platform? I am using IM 6.9.10.23 Q16 Mac OSX
Result1:
Result2:
I do not see what background subtraction has to do with your problem or example.
Re: Icon package stylization
Posted: 2019-01-05T13:09:19-07:00
by Hunter23071985
Looks good! But I use Windows 10.1709 x64 and ImageMagick-7.0.8-15-portable-Q16-x86.
You have seen the result. I'ill try IM 6.9.10.23 and will report the results little later.
If not difficult, remove the pictures from your post. Thank you!