how to rotate text around specific point by imagemagick - imagemagick

I need render text on circle path but no primitive liketexpath in SVG in imagemagick or graphicmagick document. distort is a little bit strange.
I want to put character on circle edge and rotate text with the angle from the point to center of circle. Is there command like: rotate angle x0,y0?

I have been thinking and although you did not reply to my comment to confirm what you wanted this may be what you want:
convert input.jpg -virtual-pixel background +distort SRT "10,10 30" output.jpg
http://www.imagemagick.org/Usage/distorts/#srt

Related

Splitting a region of an image into tiles

I have a set of images that are 4500px x 3000px in size.
Out of each of these images I need to extract a set of tiles in a 5 columns by 3 rows combination with each tile being 700px wide by 500px high.
What complicates the above is that the starting point for this needs to be at X:650 and Y:450 position from the top left corner of the image.
I have gotten as far as convert image.jpg -gravity NorthWest -chop 650x450 -crop 700x500 tile-%d.jpg
This gets me to a correct start position for creating the tile set but includes the rest of the blank area in the right and bottom edge of the image.
How do I go about solving this?
Within a single ImageMagick command you can crop the initial rectangle that contains all the tiles first, then crop that into the 15 output images. Try something like this...
convert image.jpg -crop 3500x1500+650+450 -crop 5x3# tile-%02d.jpg

ImageMagick/etc.: automated removal of unclean edges from scanning?

With a few thousand images like the following one, with complex edges from scanning (first a perfectly regular white one, then a very fuzzy gray/black'ish one), is there a good algorithm to figure out the coordinates of the area-to-keep? In the below example, going clockwise from the north-western corner, the optimal coordinates would be:
121,18
1934,18
1934,1312
121,1312
So that from this input image...
... can be cropped to remove anything tinted red, as shown here:
To clarify, I do know how to use ImageMagick or other tools to crop to that area. What I'm not sure about is how to figure out how to get to those above numbers? Do you just binarize the image and then go left to right until you hit "white" for the first time, then do the same from top to bottom, right to left and bottom to top? Or is there some library, script, etc. which already does that for you?
I would use vertical and horizontal projections of the image. By a simple detection of the highest transition, you easily find the limit between the background and the paper.
Your image has a border of white surrounding a border of black. So you can do two fuzzy -trim processes after padding with the appropriate color to ensure it goes all around the image. So in ImageMagick 6, it would be
Input:
convert book.jpg -bordercolor white -border 1 -fuzz 55% -trim +repage -bordercolor black -border 1 -trim +repage book_trimmed.jpg
Result:

Rotate and crop an image, while keeping its original size

I have a JPG image with a known size of 3072x2048. Now I want to rotate that image by any degrees (e.g. 45), while keeping its original size. Thus - using ImageMagick on the command line - I first want to rotate, then crop the image, like this:
convert -rotate 45 -gravity center -crop 3072x2048 +repage original.jpg rotated-45.jpg
By using -gravity center I specify to crop the center part of the image, which is what I want. This operation produces four output images:
rotated-45-0.jpg
rotated-45-1.jpg
rotated-45-2.jpg
rotated-45-3.jpg
The first image rotated-45-0.jpg is exactly the final image I want to get. The other three I don't need. I could delete them, but I think it would be nicer to not generate these "extra" images in the first place. So I thought I could do it with this command instead:
convert -rotate 45 -gravity center -crop 3072x2048+0+0 +repage original.jpg rotated-45.jpg
This only produces one output image, however, now the top-left corner of the image is being cropped. So apparently the -gravity center is not used any longer.
Any ideas what I am missing here?
Using ImageMagick you can rotate an image any number of degrees while keeping the original canvas dimensions using "-distort SRT"...
convert original.jpg -virtual-pixel black -distort SRT 45 rotated-45.jpg
Use "-virtual-pixel" to specify how you want to handle the parts that were outside the canvas before the rotation. In this example I used "black". You can use black, white, background, tile, mirror, or none.

How to crop or chop the images at the L shaped corner edges with imagemagick

[]
I use imagemagick -6 for conversion.
I have an image like above. Actual image resides in the rectangular area. I need to remove the L shaped corner edges as you see. I tried with lots of options available in : https://imagemagick.org/Usage/crop/#splice . As crop/chop and shave options applicable symmetrical to both sides. I was thinking If I can just splice the un-wanted L shaped areas.
I tried with convert -background blue -gravity East -splice 10x10 +repage but of no luck. It basically adds a cross in horizontal and vertical in the middle of the image. Please advise if it possible just to erase/chop a particular area. e.g. some portion of an edge and not the complete edge. The reason here is I don't want to chop-off any part of rectangular shape but the L shapes above and below. Basically looking for removing/splicing with white color just L shaped one corner at a time if possible using Imagemagick-6. As I don't know about the pixel size in advance. I don't know if one liner solution will work.
Many thanks!
I think you mean this:
magick image.png -crop 305x365+232+58 result.png

Imagemagick skew image with 4 (x,y) coordinates

I have 4 (x,y) coordinates between which I want place image as example given below.
The whole image must be placed within this area without cropping.
Using this 800x600 balloon:
You can use a "Perspective Distort" like this:
convert balloon.jpg -matte -virtual-pixel transparent \
-distort Perspective '0,0,50,0 0,599,100,599 800,0,750,100 800,600,500,500' result.png
There are basically 4 pairs of points in the parameters,i.e.
Pt1X,Pt1Y,Pt1NewX,Pt1NewY Pt2X,Pt2Y,Pt2NewX,Pt2NewY Pt3X,Pt3Y,Pt3NewX,Pt3NewY Pt4X,Pt4Y,Pt4NewX,Pt4NewY
So the command above moves point 0,0 to 50,0 and moves point 0,599 to 100,599 and so on.
I have labelled each of the points in red and drawn the path along which each one has moved in green.

Resources