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?".
darkfrei
Posts: 15 Joined: 2018-01-16T11:47:26-07:00
Authentication code: 1152
Post
by darkfrei » 2018-11-13T09:16:15-07:00
Hi all!
I know how resize, but what tool I can use for bending?
Now I need make a lot of images like that (magenta is for position):
Original image for example
image-01.png
Resize to 200x200
image-02.png (200x200 px)
Bend this image to (it's also 200x200)
image-03.png (200x200 px)
And resize it back to 20x20
image-04.png (20x20 px)
Last edited by
darkfrei on 2018-11-13T10:45:31-07:00, edited 2 times in total.
GeeMack
Posts: 718 Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA
Post
by GeeMack » 2018-11-13T09:30:36-07:00
darkfrei wrote: ↑ 2018-11-13T09:16:15-07:00 I know how resize, but what tool I can use for bending?
You can use "-distort arc" to accomplish that. This command will do the 90° bend...
Code: Select all
convert input.png -background none -virtual-pixel none -distort arc "90 45 200 0" -shave 1 result.png
Learn more about using "-distort arc" to make bends and curves
at THIS link .
You may want to use "-scale" rather than "-resize" to scale up before the distort to avoid aliasing. If you're using IM version 7 use "magick" instead of "convert".
darkfrei
Posts: 15 Joined: 2018-01-16T11:47:26-07:00
Authentication code: 1152
Post
by darkfrei » 2018-11-13T10:53:35-07:00
This part is too complicated:
Code: Select all
magick image-02.png -background none ^
-gravity East -extent 400x200 ^
-virtual-pixel none -distort Arc 180 image-180.png
Here I take
image-02.png (200x200 px), add another 200 pixels on the left (west) side.
But -distort makes this picture as 456x229 px
image-180.png (456x229)
darkfrei
Posts: 15 Joined: 2018-01-16T11:47:26-07:00
Authentication code: 1152
Post
by darkfrei » 2018-11-13T13:36:45-07:00
Looks amazing! Exactly what I want. For 32 pixels here is distort "...320...".
Code: Select all
magick "Input/*.png" ^
-scale 1000%% ^
-background none ^
-virtual-pixel none ^
-distort arc "90 45 320 0" -shave 1 ^
-scale 10%% ^
Output/bend_90_%%04d.png
pause
darkfrei
Posts: 15 Joined: 2018-01-16T11:47:26-07:00
Authentication code: 1152
Post
by darkfrei » 2018-11-14T11:28:32-07:00
Another question, but for the same project:
How to make from one image a lot of them but with shift? By paint dot net it calls "panelling", but it's very big work.
So I want to make from this picture 32x32:
this spritesheet with 32 elements, every sprite was shifted one pixel to the right.
GeeMack
Posts: 718 Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA
Post
by GeeMack » 2018-11-14T11:33:18-07:00
darkfrei wrote: ↑ 2018-11-14T11:28:32-07:00 this spritesheet with 32 elements, every sprite was shifted one pixel to the right.
Try this...
Code: Select all
magick sprite1.png -duplicate 31 -roll +%[fx:t]+0 -append +repage sprites32.png