FAQ Database Discussion Community


How to find the brightest pixel?

imagemagick
How do I find the brightness (i.e. V in HSV) of the brightest pixel in an image? I have a large collection of images that will be used as background assets. In order to make sure there are no bright spots that may distract the viewer, I'd like to find...

Find edges (border of rectangle) inside an image

python,imagemagick,image-manipulation,edge-detection
I have an image of a sticky note on a background (say a wall, or a laptop) and I want to detect the edges of the sticky note (rough detection also works fine) so that i can run a crop on it. I plan on using ImageMagick for the actual...

Imagemagick convert tif to rgba16 png

imagemagick,png,tiff,imagemagick-convert
So here is my source tif image: $ identify -verbose source.tif Image: Format: TIFF (Tagged Image File Format) Class: DirectClass Geometry: 512x512+0+0 Resolution: 72x72 Print size: 7.11111x7.11111 Units: PixelsPerInch Type: Palette Base type: TrueColor Endianess: MSB Colorspace: RGB Depth: 8-bit Channel depth: red: 8-bit green: 8-bit blue: 1-bit And I've...

Resizing the image with padding using convert on ubuntu

linux,image,imagemagick,image-resizing
I am using the convert command for resizing the image There are two versions Following is the first one, the resultant image maintains the aspect ratio but the image does not necessarily be of size nxn convert temp.jpg -resize nxn temp.jpg The second version convert temp.jpg -resize nxn! temp.jpg It...

How can I create an ImageMagick montage without empty space?

imagemagick,montage
I am creating a large number of montages using a set of images. The way I want the montages arranged is with three images across the top and two images across the bottom. The command I have right now is as follows: montage logo.png 1430410987_ACR02.png 1430410987_ACR01.png \ 1430410987_LHC1.png 1430410987_LHC_dashboard.png \...

Convert a directory of Kodak PhotoCD images into TIFF format

linux,imagemagick,batch-processing,image-conversion
I have a directory full of Kodak Photo CD files (with file extension .pcd) and I was disappointed (and alarmed) to find that neither GIMP nor digiKam could open this old image format. Time to move these old files to a format with better software support. How can a TIFF...

How to lighten an image using ImageMagick like when using compare?

imagemagick
As you see in the answer “Diff” an image using ImageMagick, the "delta" image is somehow lightened: How would I lighten an image just like that using ImageMagick?...

How to apply pagecurl effect on a static image by PHP

php,imagemagick,page-curl
I want to apply a curl or peel effect on an image using PHP and ImageMagick. I tried various libraries in PHP, but only ImageMagick may do the same. I want the same output as here: ...

ImageMagick escape character?

windows,command-line,character-encoding,imagemagick,imagemagick-convert
Is there an escape character I can use to pick up a copyright symbol in an ImageMagick convert command label directive? I'm trying to mark a batch of images with a credit/copyright in the bottom-right corner. The batch is being handled by CMD script running in a Windows command line...

Rapidly open 1,-1 data file as image

image,imagemagick
I'm working on a project that produces data files that are square matrices of numbers, either 1 or -1. I need to visualize this as images, and what I do now is using Matlab to open them, the matlab function imshow automatically draws those kind of matrices as monochrome black...

Why converting this PDF file fails when using ImageMagick/Ghostscript?

pdf,imagemagick,ghostscript,imagemagick-convert
I want to convert this PDF file compiled with LaTeX (XeLaTeX engine so that to use an Arabic font) and I want to upload it to the web and prevent copy and paste of its content. Since I am looking for a freeware to do that, I came across two...

How to Change the color of each pixel in a image by using Magick.Net

c#,imagemagick,magicknet
I'm new to the Magick.Net. I tried to change the color of each pixel in the image but there's no change in the new image. Here's my code. Could anyone tell me what's going on? Thanks a lot. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ImageMagick;...

Get position of one image in another image

node.js,image,image-processing,imagemagick,frontend
I have a screenshot of my browser that displays a website. Now I want to find out where the website (viewport) is positioned (relative to the whole screenshot). As seen as a rectangle with a black border in this image: I have the possibility to add anything to the DOM...

CarrierWave/MiniMagick avatar not displaying

ruby-on-rails,ruby,imagemagick,carrierwave,minimagick
Hey so I'm having some trouble with CarrierWave & MiniMagick this morning uploaded avatar images are not displaying correctly as you can see highlighted in this screenshot I've dug around the html and controllers and can't find what's wrong so I'll post all that here and see if a second...

ImageMagick code in Python script

python,operating-system,imagemagick
I need to convert an image so as it only shows the color blue as a blob, is there any way I can run this code in a python script? Or how could I go about it? The following code does the job but I don't know how to link...

Check image visible quality [PHP]

php,image,imagemagick,gd
I want to make image quality check. Maybe calculate some index of that quality. For example, lets say, user A uploads something like http://www.hyperconectados.com/wp-content/uploads/2014/03/Selfie.jpg and user B uploads something like http://www.privatewifi.com/wp-content/uploads/2014/02/selfie.jpg It's obvious, that B photo is professional and in good quality. There's another thing, that it's not good to...

Nodejs image crop by coordinates

node.js,image,imagemagick,crop
Is there is way where we can give x, y coordinates while cropoing image. Currently what i am using is Imagemagick im.crop({ srcPath: upload_path+media_file_name, dstPath: upload_path+"thumb_"+media_file_name, width: 350, height: 210, quality: 1, gravity: 'Center' }, function(err, stdout, stderr){ }; This code is working but i haven't got luck with x,...

Trying to remove background and make it transparent in c++, using magick++

c++,imagemagick,magick++
I am having an image "objects.png" with a red background and I'm trying to make the background transparent. The code is straight forward but somehow I am not able to get the desired result. I am quite new to this ImageMagick business and this is my first program using Magick++....

How can I replace the white rectangle within an image using ImageMagick?

php,image-processing,imagemagick
Overview: The first picture is my original image. Here I want to replace the white rectangle shown with another image. My approach: I have created a mask image using floodfill and it looks as: Problem: Now I would like to get the distance or co-ordinates of the rectangle in the...

Magick++ to display an image with CGI

c++,imagemagick,cgi,jpeg,magick++
I recently began using Magick++ (C++ API for ImageMagick) with the goal of creating a website that could display randomly generated images. I am trying to write a CGI script which would create a JPEG Image, set the color of its pixels, and then return the image information as Content-type:...

how to divide image into three equal parts in php imagemagick and combine with some padding and output as single image

php,imagemagick
I want to display an image into three parts as triptych with the help of imagemagick PHP library. I saw the same example here http://www.rubbleimages.com/Canvas.php. Can anyone help me on this issue please ...

Dynamic alteration of graphic/canvas/divs

php,css3,svg,graphics,imagemagick
I need to be able to have some kind of a canvas in which I can draw A and manipulate it dynamically towards B. (For A and B see example drawing) The size of all rectacles must be adaptable the skewing of the red rectangle and the rotation of the...

How to speed up a complex image processing?

php,image,imagemagick,converter,imagemagick-convert
Every user will be able to upload 100 TIFF (black and white) images. The process requires: Convert tif to jpg. Resize image to xx. Crop image to 200px. Add a text watermark. Here is my PHP code: move_uploaded_file($image_temp,$destination_folder.$image_name); $image_name_only = strtolower($image_info["filename"]); $name=$destination_folder.$image_name_only.".jpg"; $thumb=$destination_folder."thumb_".$image_name_only.".jpg"; $exec = '"C:\Program Files\ImageMagick-6.9.0-Q16\convert.exe" '.$destination_folder.$image_name. ' '.$name.'...

Bash %d starts with 0, can I make it start with 1

imagemagick
I'm using python and have the following command. subprocess.Popen(['convert '+document+' '+outFile+'_page%04d.tif'], stdout=subprocess.PIPE, shell=True).wait() It works fine, except I end up with my output as XXX_page0000.tif as my first page, then numbering up. Is it possible to get the %04d in bash to start at 1 instead of 0. So that...

PHP hide or cut part of image by unwanted text or sign on the picture [closed]

php,image,image-processing,imagemagick,hide
How to hide or cut or blur for example car numbers on image? so if i have thousand of image with cars like this and i want to get something like this So in which direction i should work to do this thing? There are default tools for this?...

ImageMagick - Making 2 GIFs into side by side GIFs using IM convert

image,unix,imagemagick,imagemagick-convert
I have 2 GIFs that are the same length. I want to put the GIFs beside each other to have 1 GIF with both playing at the same time. I have tried to use the convert tool with: convert +append 1.gif1 2.gif output.gif However, this seems to blend all the...

matplotlib animation.save to animated gif very slow

python,matplotlib,imagemagick,animated-gif
I'm animating a convergence process that I'm simulating in an IPython 3.1 notebook. I'm visualizing the scatter plot result in a matplotlib animation, which I'm writing out to an animated gif via ImageMagick. There are 3000 frames, each with about 5000 points. I'm not sure exactly how matplotlib creates these...

ImageMagick command without intermediary file fails

imagemagick,imagemagick-convert
I'm working on the example from ImageMagick called "Gel" Effects on the ImageMagick Example pages. Instead of executing the ImageMagick script in many steps with intermediary images, I want to do it in ONE step with no intermediary files. My code looks like this (95% same as the example): convert.exe...

Calculate the main memory consumption of ImageMagick convert when appending images

imagemagick,imagemagick-convert
I append several PNG images with the ImageMagick convert tool. convert -set colorspace RGB `ls *.png` -append outout.png This are the color parameters of the input files: $ identify input1.png input1.png PNG 9600x1800 9600x7200+0+0 8-bit sRGB 355KB 0.000u 0:00.000 4 input files exist with identical parameters. The output file has...

GraphicsMagick using nodejs not returning correct image

css,node.js,image,imagemagick
I am using GraphicsMagick. This is the image: https://hbr.org/resources/images/article_assets/hbr/1405/F1405A_A.gif which I used for cropping: My code is here: gm(request(url), "myimage.jpeg") .resize(270, 270, '^') .gravity('Center') .quality(50) .crop(270,270) .compress('JPEG') .flatten() .stream(function (err, stdout, stderr) { if (err) console.log(err); else { //upload the file file.uploadFileFromGm(fileDetails, stdout, cb); } }); The code is working...

Imagemagick, clear noise from QR-code image

imagemagick,qr-code,noise-reduction
I have QR-code scanned from document, when I trying do decode it with online decoder, like http://zxing.org/w/decode.jspx or other, they not find QR-code, but when I decode with camera on smartphone, it's decode correct text. I think it's because of small noises in image, how can I clear it with...

easyimage : set re-sized image background to transparent

javascript,node.js,imagemagick,alpha-transparency
im using easyImage moudel built on top of ImageMagick i'm trying to resize image and set the background to transparent but it always white , there is no good documentation for easyImage moudel here is my code easyimg.resize({ src : "assets/pic.png", dst : assets/dir/pic.png, width : 500, background : "transparent",...

Imagemagick crop while keeping size

imagemagick,imagemagick-convert
I want to crop the top 10 pixels of an image, but to keep the width All exmaples I found look like convert rose: -crop 90x60-10-10 crop_all.gif I need to supply the 90x60 so for the result size How can I crop with something like +0+10 and not supply a...

ImageMagick, Bash script to label with comment and image sequence number

bash,imagemagick,montage
I would like to have a set contact sheets for 70 photos. And, each photo would have similar to this label: n Comment where n indicates the image number. My Bash script correctly shows the comment. For the image sequence number I am puzzled. #!/bin/bash /usr/bin/montage \ -monitor \ -tile...

TYPO3 6.2 scaling img using gifbuilder did't work

imagemagick,typo3,typoscript,yag
After upgrading TYPO3 from version 6.2.9 to 6.2.10 the scaling images using GIFBUILDER didn't work. When I'm testing image processing in Instal Tool everything looks ok, byt when I want to change img using GIFBUILDER scaling img didn't work. My actual configuration looks like this: 'GFX' => array( 'colorspace' =>...

Finding shapes in an image using ImageMagick

image,image-processing,imagemagick,edge-detection,canny-operator
I have two source images: They seem equivalent, however, they are slightly shifted. Thus I created a diff image where the difference from each image is color coded (green and red). I created it like this: convert first.png second.png \ \( -clone 0,1 -compose difference -composite \ -threshold 0 \)...

How do I “read” from an existing image object instead of a file path with PerlMagick?

perl,imagemagick,montage,perlmagick
The following code generates a 300x100 image using a 100x100 tile as a source image: for (my $i = 0; $i < 3; $i++) { $image->Read("filepath/100x100.png"); } $result = $image->Montage(geometry=>'100x100',tile=>'3x1'); How do I reach the same result while only reading once from disk?...

How to convert a multi-page PDF to images using ImageMagick for PHP?

cakephp,imagemagick
I want to convert the pdf file into images. I am using ImageMagick for image conversion in cakePHP. When I take a PDF with a single page, its gets converted into image but the problem is when I take a PDF with multiple pages, then only the last page of...

Paperclip multiple spoof media type depending of 'file' version

ruby-on-rails,imagemagick,paperclip,paperclip-validation
I have an application managing some files like .blend files. .blend is not a standard mime type, so I add this options into config/environment.rb: Paperclip.options[:content_type_mappings][:blend] = "application/octet-stream" The value "application/octet-stream" is the value returned by the command $ file -b --mime 'x.blend' application/octet-stream; charset=binary $ file -v file-5.11 The issue...

Does anyone know how to convert to little endian .pfm file from ImageMagic?

imagemagick
I'm looking for method about to convert little endian.pfm file from imageMagick. As I know we can get a pfm file like this. convert input.bmp output.pfm This output file is made by Big endian. But I want to convert as Little endian. So is there any method to convert to...

NodeJs runing ImageMagick convert all images from directory

node.js,imagemagick
This is basic imagemagick setup for node.js that i came across lately. I understand that question im asking is very newbie but im new to node js and imagemagick and i wanted to try to make it dynamic. Current script bellow is croping one specific file, is there a way...

Share ImageMagick files over network drive without users installing ImageMagick?

python,imagemagick,install
Is it possible to share ImageMagick files with others over a network drive (ex.: Z:), without having the users install ImageMagick? ImageMagick works fine on my own machine as I used its binary installer and set up Windows environment variable ("MAGICK_HOME"). I tried using Python to auto setup the user's...

ImageMagick No decode delegate for this image format

php,ios,imagemagick,imagick
I work under windows and wamp server. this is my PHP code with Imagick $imagick = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/' . $this->_name); where $_SERVER['DOCUMENT_ROOT'].'/'.$this->_name displays : D:/Sources/my_project/public/media/2/9/1/05201502/55450e1b6543a05201502_9.PNG I checked that image and it does exist in the folder. But Imagick throws an exception : Uncaught exception 'ImagickException' with message 'no...

How to properly generate an A3 sized pdf from jpg with convert

imagemagick,pdf-generation,image-resizing,imagemagick-convert
On linux using the imagemagick tool convert, I want to convert my large jpg files into A3 pdfs <= 10MB in order to print those files with the best quality at the store. When running: $ convert summer-bokeh.jpg -quality 100 -density 300 -resize 2480x3508! summer_resized.pdf I'm trying to force the...

crop options in imagemagick?

imagemagick,im4java
I'm using im4java api to crop images. I never used command-line for imagemagic. there are function, crop(int width,int height,int x, int y, String special) crop(int width,int height,int x, int y, Character special) I can understand, what are first 4 parameters(height, width, x ,y) for. Can anybody explain to me, what...

Translate ImageMagick CLI to PHP Imagick API

php,api,imagemagick,command-line-interface,imagick
I have problem with translating ImageMagick CLI command to Imagick PHP API. I looked at threads about it on Stackoverflow but people there used other commands... > convert color-to-add.png test.png -compose CopyOpacity mask-with-alpha.png > composite -compose multiply test.png mask-with-alpha.png compose-result.png I can't use exec method. I still try do do...

Why this parameter '+profile “*”' get convert killed?

imagemagick,ubuntu-14.04,imagemagick-convert
If I run this command, convert -limit memory 2071963648 -quality 100 -alpha off -density 165% -scene 1 infile.jpg outfile.png The conversion runs without any issue. However if I add +profile "*", convert +profile "*" -limit memory 2071963648 -quality 100 -alpha off -density 165% -scene 1 infile.jpg outfile.png The process is...

TCropping images with loop in imagemagick

bash,imagemagick
A pretty basic question but I'm new to Imagemagick (and bash) and I'm having trouble batch cropping images in a folder. I've tried using a loop: for image in '/home/donald/Desktop/New Folder'*.jpg; do convert "$image" -gravity center -crop 95X95% "${image%.jpg}"-modified.jpg done but it returns: convert.im6: unable to open image `/home/donald/Desktop/New Folder/*.jpg':...

How to use GraphicsMagick to negate the alpha channel of a picture

imagemagick,graphicsmagick
I want to invert a image with transparent background, i.e. from , transparent background to , transparent "We" In ImageMagick, we can do this by convert 1cut.png -channel a -negate +channel 1cut_nega.png as mentioned in http://www.imagemagick.org/discourse-server/viewtopic.php?t=18842 What is the equivalent command in GraphicsMagick? If I use $ gm convert -channel...

Install Perl Image::Magick on Fedora

perl,imagemagick
I'm installing Image::Magick via cpan and I keep getting this error. I've tried with and without forcing it. I've trimmed the install log. I've read something about missing an ImageMagick.h file but don't exactly know anything other then that. Apparently this has been a common problem since 2007..... [[email protected] ~]$...

How to composite large images stored on S3 in ImageMagick from EC2 instances?

amazon-ec2,parallel-processing,imagemagick,celery
I have an ongoing list of image processing tasks to do, using ImageMagick to composite large individual graphic files (20MB each). These images are currently stored on S3 (approximately 2.5GB in total). I was thinking to use multiple EC2 instances to process the tasks, composite the images and upload the...

ImageMagick crashing for JPEG with incorrect density value

php,image-processing,imagemagick,dpi
I am trying to convert an image with ImageMagick. I am cropping and resampling to 112 DPI: convert myimg.jpg -crop 1024x683+0+0 -resize 100% -resample 112 downsample.jpg A script runs through many images of varying DPI and downsamples them. However, a particular file has gummed up the script. Somehow, the file...

Create two sizes of an image using one ImageMagick command

image,imagemagick,image-resizing
I am using ImageMagick to generate small size JPEG versions of large TIFF images. For each TIFF image I must generate two smaller JPEG versions. I am currently using two convert commands: convert.exe 4096-by-3072px-120mb.tif -resize "1024x>" -strip -interlace Plane 1024px-wide-for-web.jpg convert.exe 4096-by-3072px-120mb.tif -resize "1600x>" -strip -interlace Plane 1600px-wide-for-web.jpg Converting TIFF...

ImageMagick move watermark from top left to bottom right?

php,imagemagick
I've got this working adding a watermark onto my image at the top left, How can i change it so it adds in the bottom right? Here is my current code: $watermark = new Imagick(); $watermark->readImage("images/watermark_boxart.png"); $im->compositeImage($watermark, imagick::COMPOSITE_OVER, 3, 3); Thanks...

Rotate individual letters of the same word in ImageMagick

imagemagick,captcha
I'm generating CAPTCHAs for training data and I have a pretty good ImageMagick script going already. However, one thing I really want is for individual letters of the word to be slightly rotated, see for example this reCAPTCHA: Is there an easy (or hard) way to accomplish this effect? ...

Performimg image processing and save image with same compression factor using matlab

image,matlab,imagemagick,jpeg
I can read an Image's metadata and find the image quality with the following command in linux, which I think is from ImageMagick: identify -verbose image.jpg The output of this command is the following: ... Iterations: 0 Compression: JPEG **Quality: 96** ... The important thing to me is to find...

Nodejs GM module ImageMagick - strange Error

node.js,heroku,imagemagick,graphicsmagick
I have a very strange error. I'm using MAC OS X 10.9.5. When i use some functions from GM (npm install gm) like resize or something else i got this error. events.js:72 throw er; // Unhandled 'error' event ^ Error: spawn ENOENT at errnoException (child_process.js:988:11) at Process.ChildProcess._handle.onexit (child_process.js:779:34) I have...

Add margin between appended images with GraphicsMagick/gm

javascript,node.js,imagemagick,graphicsmagick
Using the gm package for Node, I can append three images horizontally: gm('img1.jpg').append('img2.jpg', true).append('img3.jpg', true).write('out.jpg'); This creates something like: +---+---+---+ | 1 | 2 | 3 | +---+---+---+ Where all the images touch. However, I want 10px of margin, so it looks like this: +---+ +---+ +---+ | 1 |...

Transparent PNG created in Imagemagick drawn as opaque in FFMPEG

ffmpeg,imagemagick,transparency
I am trying to script the creation of videos using ImageMagick to create some overlays which are then placed on top of a video. If I try to use the image created by ImageMagick directly the transparency is drawn as opaque. I have created a transparent PNG using ImageMagick draw...

Zoomming into an image with ImageMagick

image,imagemagick
I would like to zoom into an image test.png. That is, as a silly example, I would like to go from this to this The only way I was able to do it was with convert -resize 110% test.png -gravity Center \ -crop 800x600+0+0 +repage 1.png This is re-scaling the...

Magick++ not loading from blog

c++,imagemagick,physfs
I am using Magick++ to load some images. Because I want to wrap PhysFS for all of my image loads, I needed to load an image by blob instead of file path. This code: Magick::Image test("path/to/some.png"); Works without issue. However once I do a blob I get an exception: PhysFS::ifstream...

How to Convert PSD into PNG, using Python Wand / ImageMagick?

python,imagemagick,png,psd,wand
I tried converting PSD to PNG, but as I save the PNG, Wand (wand-0.4.0-py2.7) spits out all layers inside the PSD as separate PNG files (the last file saved is the one I want). So how to correctly convert from PSD to PNG? # Convert a large PSD to small...

I can't convert with ImageMagick

php,centos,imagemagick
I'm using ImageMagick to convert a PDF file. I use this PHP snippet: $cadena = "/usr/local/bin/convert -density 100 -colorspace rgb ".$name_path." ".$images_path."/convert.png"; shell_exec($cadena); where $name_path is the PDF file directory and $images_path is the images directory. This code in console (CentOS) works perfectly. But when I try to use shell_exec()...

Cleaning up an image for OCR with ImageMagick and 'textcleaner'

imagemagick,ocr,tesseract,imagemagick-convert
I have the following image that I'd like to prepare for an OCR with tesseract: The objective is to clean up the image and remove all of the noise. I'm using the textcleaner script that uses ImageMagick with the following parameters: ./textcleaner -g -e normalize -f 30 -o 12 -s...

Convert multiple images with ImageMagick

imagemagick
I want to convert all my PNGs to PNG using ImageMagick (I need this because AndroidStudio has some issue with the original PNGs. ImageMagick is able to fix this issue by re-exporting the PNG.) If I do: convert a.png a.png it works. But how do I do this for many...

PHP Imagick compositeImage set position

php,image-processing,imagemagick,imagick,watermark
I use the Imagick library for Image processing. I'm using this function: https://php.net/manual/ro/imagick.compositeimage.php How can I place the second image above the first image in the left corner for example? I'm using this function to add a watermark above all images. But the watermark is centered on all images. I...

Unable to delete created and streamed file

c#,asp.net-web-api,imagemagick
I'm using Magick.NET to convert a PDF to a PNG and stream it back to the page via ajax. Everything works until a PDF is uploaded twice. When trying to overwrite or delete the existing file, the debugger tells me that the file is in use by another process. Here's...

GraphicsMagick crop PDF

pdf,imagemagick,graphicsmagick
I've got a 8.5x11 PDF at 300dpi. It has a single UPC label in the top left corner of the PDF. Imagine that there could be 30 labels on a 1 sheet, but we just have 1 label. I'm trying to crop the PDF to be just the size of...

How to increase quality of image through imagemagick binary convert?

php,image,imagemagick,exec,imagemagick-convert
Hereby,I working in Image conversion using imageMagick binary convert. When i resize small image into large image and also increase quality of image. Here my sample code: $img = 'old_image.png'; $path1= 'new_img.png'; exec("convert $img -quality 100% -density 600 -resize 2480x3508 -depth 400 $path1"); When i used this command it working...

Running convert command of image magic using Java gives unable to load module error

java,imagemagick
I have written a class that execute convert command of imagemagic. public class ImageMagicDemo { public static void main(String[] argp){ ProcessBuilder pb2 = new ProcessBuilder("G:\\project\\installation\\imagemagic\\convert","G:\\demo\\image\\frame.jpg", "-resize", "20x20", "G:\\demo\\image\\resizeImage\\frame1.jpg"); pb2.redirectErrorStream(true); Process p2; try { p2 = pb2.start(); BufferedReader br = new BufferedReader(new InputStreamReader(p2.getInputStream())); String line = null; while((line=br.readLine())!=null){...

How to create transparent image for rubber stamp in ImageMagick

imagemagick,imagemagick-convert
I have to create an image, which is an overlay texture made up of a white image with some transparency to give it the appearance of a rubber stamp. For reference see the image "stamp_overlay.png" in the video http://railscasts.com/episodes/374-image-manipulation . This is what i did: convert -size 70x70 canvas:white stamp_overlay1.png...

How to store ImageMagick output into Bash variable (and then use it)?

bash,imagemagick,imagemagick-convert
I use ImageMagick and need to do conditional resize of images. For that I store results of the identify tool into variables. $infile='test.jpg' width=$(identify -ping -format %w $infile) height=$(identify -ping -format %h $infile) But before resizing I want to do some transformations that change image size: -trim and -shave. So...

ImageMagick compare: exit code 1 when spawned from Node.js, but exit code 0 when run from the command line

javascript,node.js,imagemagick,spawn,external-process
$ compare --version Version: ImageMagick 6.9.1-1 Q16 x86_64 2015-04-15 http://www.imagemagick.org Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC License: http://www.imagemagick.org/script/license.php Features: DPC Modules Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png xml zlib $ node --version v0.10.33 I'm writing a Node.js script to automatically process some images for me. When...

I need to leave the biggest object in image

image-processing,imagemagick,object-detection
I need to detect the biggest object from image with ImageMagick. It can be bigger or smaller, or can be in other location. It's always black, and background always white.

ImageMagick : Compose with results of multiple convert

imagemagick,imagemagick-convert
I want to create an image from to others, which are results of convert operations their self, without saving intermediate results to file system. Long explanation: I have two images, the two needs specific transformations : avatar.jpg needs to be transformed to a rounded image -> rounded-avatar.jpg background.jpg needs to...

Use chop before resize in Imagemagick

ruby-on-rails-4,imagemagick,paperclip
I am using paperclip gem to process images. In some images, I need to chop the top 35 pixels of the source image and then do the conversions and processing Currently I am using :convert_options => { all: lambda{ |instance| "#{!instance.chop_top.blank? ? '-chop 0x35' : '' } -limit memory 64...

memory problems with imageMagick?

windows,imagemagick,imagemagick-convert,color-palette,hdd
I have problems using convert F:\path\source.png -define registry:temporary-path=F:\path -limit area 0 -type palette -colors 256 F:\path\target.png the temporary-path and my source and target images are on an external hard drive. I used area 0 because I don't want ImageMagick to use my systems memory or C:. The error(s) I am...

Are PDF dimensions meaningful when measured in pixels?

pdf,image-processing,imagemagick,pixel,dimensions
I've been testing two ways of measuring the dimensions of PDFs in pixels using two Python modules - Wand (ImageMagick bindings) and GDAL. Getting the dimensions of this PDF returns completely different results with each module: Wand reports 556x748 GDAL reports 2317x3117. Is one of these 'wrong'? If I understand...

Compare images and remove duplicates

image,compare,imagemagick,png
I have two folders with images, they're all PNGs. One folder is a copy of the other with some images changed and some added. The filenames are the same but the image contents may be different. Other attributes like time stamps are completely random, unfortunately. I want in the newer...

PHP Imagick crop image with negative offset and keep negative space

php,imagemagick,imagick
I'm using php Imagick::cropImage and i'm having some trouble. Let's say I have this image: And I want to crop the image with this crop area: This is the PHP code I am using: $width = 200; $height = 200; $x = -100; $y = -50; $image = new Imagick();...

Python subprocess: pipe an image blob to imagemagick shell command

python,image,shell,imagemagick,subprocess
I have an image in-memory and I wish to execute the convert method of imagemagick using Python's subprocess. While this line works well using Ubuntu's terminal: cat image.png | convert - new_image.jpg This piece of code doesn't work using Python: jpgfile = Image.open('image.png'); proc = Popen(['convert', '-', 'new_image.jpg'], stdin=PIPE, shell=True)...

Find the first black pixel in every row with ImageMagick

imagemagick
For every row in an image, I would like to find the first black (or first non-white) pixel in that row. For example, for an image like this: I would expect output like: 0 1 0 Or something close to that that I can parse. I think there might be...

CImg failed to recognize the format “jpeg”

xcode,imagemagick,cimg
To load image, I installed the CImg library in my mac(OSX 10.10). Luckily I managed to display the bmp picture, but I failed to load and display other formats like png or jpg. Then I installed the ImageMagic which is downloaded from http://cactuslab.com/imagemagick/ and then run the program. The errors...

resize image to specific height and width value using im4java?

imagemagick,jmagick,im4java
I need to re-size image to any specific height and width value. But I'm not getting resized result. here is my code, please tell me either i'm doing something wrong or missing something. IMOperation operationSmall = new IMOperation(); operationSmall.addImage("conf/error.png"); operationSmall.resize(300, 1000); // w*h operationSmall.addImage("conf/errir_small.png"); Original Image size: 1280x960 px. re-sized...

Comparing images in which some parts are variable, but should not matter

c,imagemagick
I am concerned about to find dissimilarities between images as shown in the samples underneath with the black oval shape. My problem is that some part of image is also variable, but I do not want to consider this part when finding dissimilarities. To overcome this problem I want to...

Best image optimization technique for Rails

ruby-on-rails,ruby,image,optimization,imagemagick
We use images in lots of places within the site: header image for articles image for the avatar and so forth. I have the control to make sure an image doesn't exceed 5mb. However, the page takes to long to load. We use Ruby to produce the APIs and Angular...

Why use ImageMagick in CMS like MediaWiki instead of simply using browser methods?

imagemagick,mediawiki,graphicsmagick
Can somebody explain to me why I should possibly use ImageMagick (or the fork GraphicsMagick) in a CMS instead of simply displaying and sizing my images via CSS? The browser methods cannot fail and are automatically updated on client side, the ImageMagick-binary can fail on the server and I have...

Carrierwave image resizing not working

jquery,ruby-on-rails,ruby,imagemagick,carrierwave
I cannot get the image resizer that I put in my rails app to work properly. I added a resizer to picture_uploader.rb but it's not working correctly: uploader/picture_uploader.rb class PictureUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick process resize_to_limit: [400, 400] if Rails.env.production? storage :fog else storage :file end # Override the directory...

Imagemagick: remove alpha component (replace all intermediate alpha pixel with solid pixel)

image-processing,command-line,imagemagick
To solve Android build issue I need to replace all intermediate alpha pixel with solid pixel (leaving transparent background as is). How to that with ImageMagick or other-command line tool to all image in a tree? Image bg_all_block.9.png Image btn_bg_common_press.9.png UPDATE: I have found that I can detect if alpha...

I can't seem to get pictures to upload with paperclip, I don't get an error after uploading

ruby-on-rails,imagemagick,paperclip,fog
I'm not sure if its imagemagick or not! This is in my User.rb, I don't get any errors, Just a blank image! Please let me know how I can fix this! class User < ActiveRecord::Base has_secure_password validates :email, :name, presence: true, uniqueness: true validates_inclusion_of :age, in: 10..100 validates :password, presence:...

Compositing premultiplied images using ImageMagick

imagemagick,premultiplied-alpha
I have two images. One is background with no alpha. The other is a white cloud. The alpha of the cloud image is premultiplied with black. When I composite them the white cloud has black in it, so it looks grey instead of white like it should. I'm doing: convert...

Serving SVG as JPEG using Imagick and PHP

php,xml,svg,imagemagick,imagick
I have an SVG string that I want to serve as JPEG using PHP. For this (and a lot more things) I am using Imagick. Below is the code from PHP: $svg = '<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="28.125px" height="28.125px"...

ImageMagick : get image width return undefined

javascript,node.js,imagemagick
im using easyImage moudel built on top of ImageMagick i'm trying to store image width in a variable but it return undefined var width = null; var imageWidth = easyimg.info(fileSrc).then(function(file){ // get the width console.log(file.width); width = file.width; }); console.log(width); first console it gives me a number but the second...

RMagic gem require error. RMagick2.so cannot be opened

ruby-on-rails,ruby,imagemagick,rmagick
When I try the following in my controller, require 'RMagick' and running RAILS_ENV=production rake gems:install I am getting the following error. rake aborted! libMagickCore.so.2: cannot open shared object file: No such file or directory - /usr/lib64/ruby/gems/1.8/gems/rmagick-2.10.0/lib/RMagick2.so When I checked, the file RMagick2.so is present in the directory. ImageMagick is also...

Photoshop script to export layer combinations

imagemagick,photoshop,photoshop-script
I want to make a Photoshop script that lets me export all five layers in a group to a png file - in combination with every single layer from 2 other groups. It's a bit vague so I'll try to illustrate what I want to accomplish. There's the base group...

convert and crop image in tiles with python

python,imagemagick,crop,imagemagick-convert,wand
I tried to tile a JPG image in python. Usualy I use imageMagick .. so I have seen than wand seems to do this work ... But I am not able to translate convert -crop 256x256 +repage big_image.jpg tiles_%d.jpg someone ca help me ?...

ImageMagick Multiply two images (add color)

imagemagick,multiplying
I can't find command for ImageMagick which do effect likes on images below (dont worry, these funny imgs are for example only:-) ). I tried many solutions but the problem is that any elements on gradient disappear after add color to it. I can't find solution for this, because after...

Imagick Interprets external image as HTML

php,imagemagick,imagick
The problem I'm having is that when saving an image from a specific external website (not all websites), I get an error where the image is interpreted as html and not as another image format. So far, this website is the only site that I've experienced this problem on, but...

Need to crop+resize ~300000 files. Runtime = 4+ days. How can I speed up my bash script?

bash,imagemagick,runtime,imagemagick-convert,mogrify
I am working on creating a video timelapse. All the photos I took are .jpg images shot at 4:3 aspect ratio. 2592x1944 resolution. I want them all to be 16:9 at 1920x1080. I have written a little script to do this, but the process is not very fast. It took...

php remove pixels border around an image

php,image,imagemagick,gd
I use the following code to display a remote image and cache a local version of it. Now i need to find a way to remove 10 pixels all around the image because there's a border that needs to be removed before the image is displayed/cached. How can i use...