imagemagick-convert

ImageMagick resize - set width for both landscape and portrait images

给你一囗甜甜゛ 提交于 2019-12-05 11:43:39
I'm trying to get images resized to a given width , with the height being adjusted proportionally - no matter if the image has landscape or portrait orientation. I have two images I test the ImageMagick convert -resize command with and from what I have read, I would expect the following to work for any kind of image: convert source.jpg -resize 200 out.jpg The problem is, it doesn't. Here are my results: Source Image 1: landscape , 3264 × 2448 , resizes to 200 × 150 ==> WORKS Source Image 2: portrait , 3240 × 4320 , resizes to 150 × 200 ==> FAIL Now, I know I could fix this by reading in the

ImageMagick memory usage

淺唱寂寞╮ 提交于 2019-12-05 11:01:00
I have 100 PNG-files and each of them is 8250x4090 big. I need to append them with Imagemagick to one big PNG-file (82500 x 40900) so that I have 10 rows and 10 columns . I know how the code must look like but I get the errors: convert.exe: unable to extend cache `C:\Row_345.png': No space left on device @ error/cache.c/OpenPixelCache/3689. convert.exe: Memory allocation failed `C:\Row_345.png' @ error/png.c/WriteOnePNGImage/8725. First question: How much space is needed (approximately)? I have 8 GB of Ram and 30 GB free SSD and it wasn't enough. The pictures have polygons and lines in up to 5

How to convert svg to eps using Imagemagick?

倖福魔咒の 提交于 2019-12-05 10:19:06
I am trying to convert svg image to eps using Imagemagick. I am able to convert the image using Imagemagick, but the image size is too high when compared to the original image size and the content is not displayed correctly compared to the svg. I was just wondering this too. However, it appears that Imagemagick might not be the best tool to do this. Imagemagick is a "raster image processor," but SVG and EPS are vector formats. So using Imagemagick will cause those images to lose information as it has to convert from a vector format, to a raster format, and then back to vector. This probably

ImageMagick sampling factor

感情迁移 提交于 2019-12-05 04:49:13
I have been using ImageMagick command line tool for jpeg compression of the images. However, I'm trying to understand the role of sampling factor. It says the sampling factor is used to specify the block size i.e. 8x8 or 16x16. However, I can't find the default values used if I omit this parameter. Also, I tried fetching properties of an image by using the following command: identify -verbose image.jpg It shows sampling factor values as 1x1, 1x1, 1x1. What does it mean? Either it should be 8x8 or 16x16 or 32x32.... Could anyone please give me an idea where to find these details? Iamiuru From

How do I convert a base64 image?

空扰寡人 提交于 2019-12-05 02:26:30
I am trying to use the "convert" command-line tool from ImageMagick. I have a base64 encoded png file and I need to convert it to another format. I am looking at documentation and a forum discussion which suggests that I should be able to use this syntax: convert inline:file.txt file.jpg But when I do this, I get this error message: convert: corrupt image `file.txt' @ error/constitute.c/ReadInlineImage/910. What am I doing wrong? How do I get convert to read a base64 image file? Mark Setchell Updated Answer - now that I understand it better myself :-) Basically, you can base64 encode an image

Batch crop and resize images to create thumbnails

佐手、 提交于 2019-12-05 00:07:29
问题 I have a large set of jpg images for which I want to create thumbnails. The images all have different sizes and resolutions, but I would like all thumbnails to have a standard size, e.g. 120x80px. However, I do not want to stretch the images. So I would like to do something of the following: Crop image to a 1.5 : 1 aspect ratio. Center the cropping area (i.e. cut off an equal amount left and right, or above and below Resize the image to 120 x 80 px. Is there a linux command to do so? I looked

ImageMagick convert and GNU parallel together

孤者浪人 提交于 2019-12-04 23:54:24
问题 I would like to speed up the following command: convert -limit memory 64 -limit map 128 -antialias -delay 1x2 final/*.png movie.mp4 I have seen other blog posts where parallel and convert were used together so I am wondering how to make it work with the command above. 回答1: If downsizing is an option, yes, you can readily do that with GNU Parallel parallel -j 8 convert {} -resize ... {} ::: *.png where {} stands for the filename, and the files to be processed are listed after the ::: . -j

Convert entire folder to greyscale using image magick?

别来无恙 提交于 2019-12-04 20:53:07
I am trying to convert an entire folder to grayscale, using image magick. convert *.jpg -colorspace Gray -separate -average is met with this error : convert: `-average' @ error/convert.c/ConvertImageCommand/3290. What is the correct command for this? If you have lots of files to process, use mogrify : magick mogrify -colorspace gray *.jpg If you have tens of thousands of images and a multi-core CPU, you can get them all done in parallel with GNU Parallel : parallel -X magick mogrify -colorspace gray ::: *.jpg 来源: https://stackoverflow.com/questions/53262968/convert-entire-folder-to-greyscale

Imagemagick skew image with 4 (x,y) coordinates

雨燕双飞 提交于 2019-12-04 18:45:39
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

Crop circular image with dragonfly rails

笑着哭i 提交于 2019-12-04 17:10:23
I'm using dragonfly ~> 0.9.15 Given an image, I'm confused at how to use the convert method in dragonfly to crop a circular portion from the image with transparent background. I am able to use a direct image magick command to run it from command line but the example command I found uses actual files and I'm unaware of how to get the file while dragonfly processes it on the fly. Here's the actual command I took from a stack overflow question with imagemagick. https://stackoverflow.com/a/999563/1664852 convert -size 200x200 xc:none -fill walter.jpg -draw "circle 100,100 100,1" circle_thumb.png