imagemagick

How to use ImageMagick to batch desaturate images?

I have an image that is black text with some gray and pale yellowish background. I basically want to keep the text as black as possible, and make the gray and yellow comparatively lighter...at the very least, turn yellow into a light gray. What's the most efficient way to do that in ImageMagick? ...

Why '.png' files produced by ImageMagick are so much bigger than '.jpg' & '.gif' files?

Hello. I'm using ImageMagick to convert some files from one format to another. I was always under the impression that .png files were supposed to be as big/small as .jpg if not smaller, and definitely smaller than .gif. However when I run convert photo.jpg photo.png The files I'm getting out is about 6 times bigger than the origin...

Getting ruby to wait for return from command line call

I'm using the backtick method to make an ImageMagick call on each file in a directory. It looks like 10 or so images get processed and then it freezes. Forgive my ignorance but is Ruby trying to make all these calls serially without waiting for a return? How should I be doing this? I would just use ImageMagick to directly batch process ...

Most optimal way to detect if black (or any color pixels) exist in an image file?

What's the best and most flexible algorithm to detect any black (or colored pixel) in a given image file? Say I'm given an image file that could, say, have a blue background. And any non blue pixel, including a white pixel, is counted as a "mark". The function returns true if there are X number of pixels that deviate from each other at ...

How can I make a noisy background image using PHP?

I'm looking to make an image that's just noise, maybe something like this: Ideally I'd like to be able to change the colour as well. Any ideas on how to generate this? ...

Batch montage of images with paging

I have hundreds of images (png), sorted by name. They all have different sizes, but the same print resolution is to be used. I want to montage them in column, only one per row, possibly centered, and so that when the total height of the montage reaches an A4 paper height (~30cm) it starts again on another page.. I tried to do it with t...

ImagickDraw::setFont has no effect on my system; suggestions?

Running on Ubuntu LTS 8.04, PHP 5.2.8, ImageMagick 6.6.1-5 installed from source, and Imagick 2.3.0 installed from pecl. ImageMagick's 'convert' command sets fonts properly, and ImagickDraw::setFont properly complains if an invalid path to a font has been specified. However, specifying a valid font has no effect in changing the appeara...

Image Magick: resize and fill doesn't work

this is what I'm doing: convert input.png -fill white -resize 2480x3508^ out.png and I get: convert: invalid argument for option `2480x3508^': -resize. Version: ImageMagick 6.2.8 06/11/08 Q16 http://www.imagemagick.org The error doesn't present itself if the '^' at the end of the Geometry argument is removed. ...

how could create image watermark using ImageMagick

I am trying to convert a 8bpp (256) color gif to a 2bpp (4) color gif through ImageMagick. How can i put an semi-transparent image to the output file in ImageMagick? ...

How do I prevent ImageMagick convert from scaling images *up*?

I'm using ImageMagick's convert tool to generate image thumbnails for a web application. I'm using notation like so: 600x600> The images are indeed scaled to 600px wide/tall (depending on the longer side) and proportions are properly maintained, however images less than 600px in either direction are scaled up — this behavior is not desi...

ImageMagick - how to enforce min/max heights/widths?

Using ImageMagick, how can I resize an image to have a minimum: height of 150px width of 200px and also have a maximum: height of 225px width of 275px UPDATE: In case it helps, here's a further explanation of what I'm experiencing. I have a buch of images with all different ratio dimensions. Some images have 1:5 height/width ra...

Create a bitonal image for OCR using Image Magick

nice /usr/local/bin/convert -colors 2 -colorspace gray -compress group4 /var/www/html/uploads/pokemon.jpg /var/www/html/uploads/pokemontest.jpg This command worked with a really OLD version of Image Magick. With the newest version this method produces a completely black image. nice /usr/local/bin/convert -colorspace gray -compress gr...

ImageMagick bash script issue

// This works convert ${path}${dst} -crop ${crop} ${path}${dst} // but when changed to this, it fails convert ${path}${src} -trim ${path}${dst} convert ${path}${dst} -crop ${crop} ${path}"pdf_"${dst} What am I doing wrong? ...

better params for a conversion to png with imagemagick

i have to convert 60px X 60px images to png for my web site with imagemagick. convert image.jpg image.png But it's return an image with 4kbyte size. I want get a size around 1kbyte. How can i do? thanks ...

How do I create a text image with a transparent value for the text with image magick

I am using the following command to create an image of text with a shadow. What I would like to do is to create the text with a transparent opacity. system('convert -background transparent ' . '-fill rgb(127, 127, 127) ' . '-pointsize 30 ' . 'label:"This is a test" ' . '-background transparent -flatten -trim +re...

Glueing tile images together using imagemagick's montage command

This seems like it might be a reasonably common question, so I'm going to ask it using as many keywords as I can think of! I have a bunch of (well, nine) tile jpegs, with standard tile filenames. Each jpeg is 220x175 pixels: (top row) tile_1_0_0.jpg tile_1_1_0.jpg tile_1_2_0.jpg (middle row) tile_1_0_1.jpg tile_1_1_1.jpg tile_1_2_1.jpg...

Installing ImageMagick extension with php/windows

Running PHP Version 5.2.5 on Windows Server 2003 with IIS. Have virtually an identical server where we were able to install ImageMagick with no issues. It's running exactly the same version of php. Used the following steps to install, but it just won't seem to work on this server. ImageMagick itself is installed but php won't load the e...

Convert PDF to PNG using ImageMagick

using ImageMagick, what command should i use to convert a PDF to PNG? I need highest quality, smallest file size. this is what I have so far (very slow by the way): convert -density 300 -depth 8 -quality 85 a.pdf a.png Looking at what Gmail does when a user "view" a PDF, the quality is awesome and the file size very minimal. The DPI i...

Imagick: gifs, and background color

Hi, I have 2 questions about using the php imagick class that I can't get working properly... 1.) I tried resizing / cropping a gif, and treated it as a normal image. It seemed to work, except that a few frames in the middle of the animation contained a small patch of artifacts. Is there a setting that should be used when working with m...

php,unix command ,imagick help me

This command add the text "flower" to the image: convert flower.jpg -font courier -fill white -pointsize 20 -annotate +50+50 'Flower' flower_annotate1.jpg I'm using ImageMagick 2.2.0. I'm running it from PHP using: system('convert flower.jpg -font courier -fill white -pointsize 20 -annotate +50+50 'Flower' flower_annotate1.jpg'); b...