vseventer / sharp-cli

CLI for sharp.
MIT License
189 stars 20 forks source link

Help converting a imagemagick command to sharp-cli #20

Closed vico93 closed 5 years ago

vico93 commented 5 years ago

Hi!

First of all sorry for bothering you with this question.

I'm in a process to switch from imagemagick to sharp-cli but i'm having headaches trying to "convert" this composite command (who basically "stamps" a emoji .png file into a Windows Folder icon .png and outputs the composite result in another .png file for further processing):

magick <windows_folder_icon_dir>\256.png emoji_256.png -gravity SouthEast -geometry +16+29 -composite "compositeicon_256.png"

Is possible to make the same result using sharp-cli alone? Thanks in advance!

vseventer commented 5 years ago

Hi @lordvico - I suggest you look at the composite command. sharp composite --help should give you insight on how to achieve what you want.

vico93 commented 5 years ago

I tried to issue sharp composite <windows_folder_icon_dir>\256.png --image emoji_256.png --gravity southeast --offset +16+29 -o ".\<emoji_name>" but i got problems with the offset parameter. I didnt find how i could write it on documentation.

vseventer commented 5 years ago

The offset takes an array - try sharp composite <windows_folder_icon_dir>\256.png --image emoji_256.png --gravity southeast --offset 16 29 -o ".\<emoji_name>".

vico93 commented 5 years ago

Other thing: in magick i could specify the output image directly (eg. compositeicon_256.png), while in sharp i always need to specify a directory, without chance of change the output filename.

Is it right or there's another way?

vseventer commented 5 years ago

You should be able to use a filename as output - but there are some issues with this (see #16).

vico93 commented 5 years ago

Well, i'm almost giving up of what i'm trying to do - basically make windows folder icons for every twemoji glyph - for that i need to raster every svg in several pngs for every size of the icon (using svg2png), then i put the glyph in front of the folder png (thats is what i'm trying to make with the line above) and then i make the .ico with icon-gen.

BTW I have my efforts here, currently i'm making it on batch. If i could make everything only on sharp... but i completely lost right now.

vseventer commented 5 years ago

Closing this - see #16 for follow-up.