imagemagick-convert

Translate CLI ImageMagick to Magick++: threshold and depth

允我心安 提交于 2021-02-11 15:20:49
问题 I am converting a system call to Magick++ in my code, but I am having some trouble converting the threshold and depth . The original: convert /foo/bar.ppm -crop WxH+X+Y -threshold 50% -depth 1 /foo/out.ppm My current C++ version is: Magick::InitializeMagick(*argv); Magick::Image img; img.read("/foo/bar.ppm"); Magick::Image temp_img(img); temp_img.chop(Magick::Geometry(X,Y); temp_img.crop(Magick::Geometry(W,H)); temp_img.threshold(.50); temp_img.depth(1); temp_img.write("/foo/out.ppm"); The

ChildProcessError for image moderation firebase function

为君一笑 提交于 2021-02-10 06:46:09
问题 I'm trying implement image moderation code to remove adult or violent content as given here: https://github.com/firebase/functions-samples/tree/master/generate-thumbnail But every time i'm getting this error: ChildProcessError: Command failed: convert /tmp/test folder/yes.jpg -channel RGBA -blur 0x8 /tmp/test folder/yes.jpg convert: unable to open image `/tmp/test': No such file or directory @ error/blob.c/OpenBlob/2712. convert: no decode delegate for this image format `' @ error/constitute

Where is convert in ImageMagick?

99封情书 提交于 2021-02-07 18:20:49
问题 I just spent an infuriating day trying to make a gif out of a series of jpg files in R. I installed ImageMagick to run the following code: system("convert -delay 40 *.png example_4.gif") but I get the following error message: Warning message: running command 'convert -delay 40 *.png example_4.gif' had status 4 which looks like a path error. Now I've looked for convert in the Imagemagick download and can't see it anywhere. Does anyone know where it is? Alternately, is there another easier

Where is convert in ImageMagick?

梦想与她 提交于 2021-02-07 18:20:24
问题 I just spent an infuriating day trying to make a gif out of a series of jpg files in R. I installed ImageMagick to run the following code: system("convert -delay 40 *.png example_4.gif") but I get the following error message: Warning message: running command 'convert -delay 40 *.png example_4.gif' had status 4 which looks like a path error. Now I've looked for convert in the Imagemagick download and can't see it anywhere. Does anyone know where it is? Alternately, is there another easier

How to perform perspective distort transformation in VIPS?

二次信任 提交于 2021-02-05 08:56:36
问题 Is it possible to do the following ImageMagick perspective distort command using VIPS? If so, what would the command be (using ruby-vips )? $ convert my_file.png -matte -virtual-pixel transparent +distort Perspective '0,0,0,60 1500,0,300,0 0,2100,0,2310 1500,2100,300,2100' -crop 300x2310+0+0 回答1: There isn't a built-in thing for perspective distort, but you can make one using mapim : http://jcupitt.github.io/libvips/API/current/libvips-resample.html#vips-mapim #!/usr/bin/ruby require 'vips'

Use ImageMagick to Generate Image from Text?

◇◆丶佛笑我妖孽 提交于 2021-01-29 05:30:37
问题 I'm trying to use ImageMagick to create thumbnail images that are 3840 x 2160. I need the image to have a black background and white text. The text should be centered vertically and horizontally. I want to be able to set a font size, but if the text would extend off the image, automatically decrease the font size so it fits with some amount of padding on the left and right. I will be doing this in bulk with several hundred thousand images. From what I've been able to find, it looks like you

Compress PDF after manipulation

笑着哭i 提交于 2021-01-28 18:22:40
问题 I have the following problem: I am receiving various scanned PDF files from a Kyocera Scanner Device. I have to automatically manipulate these PDF Files in order to: Delete the colors from textmarkers Convert the PDF to grayscale Put it in our DMS I am using a Bash-Script to do the job. For deleting the textmarker colors and converting to grayscale I use Imagemagick: convert -density 150 INPUT.pdf \ -channel rgba \ -alpha set \ -fuzz 15% \ -fill white \ -opaque 'rgb(255,200,195)' \ -opaque

How to crop the difference of two images?

拟墨画扇 提交于 2021-01-27 14:10:37
问题 I'd like to take these 2 images: And essentially produce this: I've gotten as far as using compare with fuzz to define the part that has changed. Is it possible to then get the bounding box of this area and crop the second frame? 回答1: I would do something along these lines: convert a.jpg b.jpg -colorspace gray -blur 0x2 \ -compose difference -composite \ -threshold 20% out.jpg Convert to greyscale and blur a little to hide small differences, then calculate the difference and threshold to make

imagemagick convert: how to tell if images need to be rotated?

别等时光非礼了梦想. 提交于 2021-01-01 04:40:35
问题 In my rails app, i let the user upload images to use as thumbnails for resources they've made. I do all the image processing with imagemagick's convert command: i convert to jpg, letterbox it to 800x600px and then make some smaller thumbnail versions of that. This is all working fine. The problem is that some images that have come off my iPhone, for example, have the wrong orientation. My desktop seems to variously deal with this: when i see the tiny thumbnail for the image in the file

Howto convert A4 jpeg scanned page to A4 pdf

╄→гoц情女王★ 提交于 2020-12-04 08:56:51
问题 I have a jpeg scanned page ( toto.jpg ) that I want to convert to a A4 pdf file with imagemagick convert command. I've been trying the -page A4 , -resize 595x842 and -define pdf:fit-page=A4 options but it does not work, I don't obtain the correct size : $ identify toto.jpg toto.jpg JPEG 1644x2304 1644x2304+0+0 8-bit DirectClass 902KB 0.000u 0:00.000 $ convert -density 300 -page a4 toto.jpg toto.pdf $ identify toto.pdf toto.pdf PDF 143x202 143x202+0+0 16-bit Bilevel DirectClass 3.7KB 0.000u 0