I am using convert from PDF to PNG.
$ convert -density 203.294113 -resize 6000x3300\> src.pdf[0] dst.png
But when the image is created, it has a white margin added around the origin pdf page and I don't know how to eliminate it (it doesn't matter whether "density" and "resize" are used). Thanks a lot for the help.
you can use -shave to remove border with specific size or -trim to auto-trim image
Related
I need to resize any given image to 1200x700px without distorting it, no matter if the image is smaller or bigger. its okay when something gets cropped.
is it possible to do this in a simple way or do i need a lot of if/else to get there?
what's the best approach using imagemagick (command-line)?
convert image.suffix -resize "1200x700^" -gravity center -extent 1200x700 result.suffix
I am using ImageMagick to place an image on particular location on a white background canvas, can someone help me with it?
Here is what i tried so far, this would resize my image to correct resolution and put on a right size canvas.
Convert image.jpg -resize 1025x1537 -background white -extent 1920x1536
Now, I need to move it 40 pixles to the right , 20 to bottom
Reading the documentation for the geometry argument, it seems like one can use:
... -extent 1920x1536+40+20
If you want to define the offset from another origin, then you can use -gravity type.
https://imagemagick.org/script/command-line-processing.php#geometry
https://imagemagick.org/script/command-line-options.php#gravity
I have 100s of screenshots taken from website of varying height. I would like to crop header of the images by 50px from the top irrespective of the height of the image.
convert -crop autoxauto+0x50 image-input.png image-output.png
If you start with this image where the two bars are both 50 pixels tall:
You probably mean:
convert start.png -crop x50+0+0 top.png
Or:
convert start.png -crop x50+0+50 bottom.png
I agree with #Mark's answer, however I found a simpler solution:
convert image-input.png -chop 0x50 image-output.png
I converted a 2.9M jpg to a 20x20 using 8 as the quality. but that file's size is still 48k.
here is my command
convert 238832c58dc3bc0b_29M.jpg -quality 8 -resize '20x20>' +repage 238832c58dc3bc0b_20x20.jpg
and after conveted, 238832c58dc3bc0b_20x20.jpg is 48k. I tried smalled size and quality, still 48k. it shouldn't be so big. it should be less than 10k. anybody know how to enhance it? thanks
Use -thumbnail instead of -resize or add -strip to your command.
Thumbnail removes the EXIF information apart from the color profile and strip removes the color profile as well.
I want to pixelate and/or blur an image.
I've found the command for the blurring:
$convert image.jpg -blur 18,5 newimage.jpg
to work but I cannot blur the image any more.
And how do I pixelate the image? I couldn't find a sound example around the net.
Thx
To get a proper square pixellation, try:
convert -scale 10% -scale 1000% original.jpg pixelated.jpg
This worked nicely for me, gives a sort of cross between pixelating and blurring:
convert -resize 10% image.jpg newimage.jpg
convert -resize 1000% newimage.jpg newimage.jpg
You can be sure that the data cannot be retrieved, should that be important to you.
Changing the %ages will change the amount of pixelation/blur
I don't know anything about ImageMagick, but you can try resizing the image using bicubic to a much smaller dimension, then resizing the image back to a bigger one.
The trick works using .net's System.Drawing object.