Menu
  • HOME
  • TAGS

Nodejs GM module ImageMagick - strange Error

node.js,heroku,imagemagick,graphicsmagick

IF someone will have this issue i solved it. I add variable PATH to enviroment variables in node with this value bin:node_modules/.bin:/usr/local/bin:/usr/bin:/bin

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

bash,imagemagick,imagemagick-convert

Bash can not store blobs of data that may contain NULL terminating characters. But you can convert the data to base64, and use ImageMagick's fd: protocol. # Store base64-ed image in `data' data=$(convert logo: -shave 1x1 gif:- | base64) # Pass ASCII data through decoding, and pipe to stdin file...

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

perl,imagemagick,montage,perlmagick

It's not obvious from the docs, but you can add clones to the image sequence like this: $image->Read("filepath/100x100.png"); $image->[1] = $image->[0]->Clone(); $image->[2] = $image->[0]->Clone(); $result = $image->Montage(geometry=>'100x100',tile=>'3x1'); ...

ImageMagick escape character?

windows,command-line,character-encoding,imagemagick,imagemagick-convert

A colleague found an answer involving temporarily changing code pages: chcp 1252 set "c=©" chcp 850 for %%f in (*.png) do convert -background "#FFFFFF" -font verdana -fill black label:" %c% 2015 My Company" miff:- | composite -gravity SouthEast -geometry +0+0 - "%%f" "credited\%%f.png" ...

Add margin between appended images with GraphicsMagick/gm

javascript,node.js,imagemagick,graphicsmagick

I don't really do Javascript, or node, but I can say that on the command line, I would tend to do what you ask with the montage command, but it can be done with convert. What you need to know, and what may be useful, is that you don't have...

NodeJs runing ImageMagick convert all images from directory

node.js,imagemagick

Yes, you can do it by implementing foreach by all files itself. Also you will need to install async module: npm install async Example code: var async = require('async'), fs = require('fs'), im = require('imagemagick'), maxworkers = require('os').cpus().length, path = require('path'); module.exports = resize; function resize(params) { var queue =...

Use chop before resize in Imagemagick

ruby-on-rails-4,imagemagick,paperclip

solved it with +repage and not in :all so essentially it looks like all: "-limit memory 64 -limit map 128", mobile_sm: lambda{ |instance| "#{!instance.chop_top.blank? ? '-chop 0x31 +repage' : '' } -resize 640 -quality 90 -strip -interlace Plane"}, mobile_lg: lambda{ |instance| "#{!instance.chop_top.blank? ? '-chop 0x31 +repage' : '' } -resize...

TCropping images with loop in imagemagick

bash,imagemagick

I believe you have no jpg files in the /home/donald/Desktop/New Folder/ directory. The shell will interpret it as the literal string /home/donald/Desktop/New Folder/*.jpg if there are no files matching the wildcard-ed string. See this example: $ for f in *.jpg*; do echo $f; done file.jpg file2.jpg $ for f in...

Rapidly open 1,-1 data file as image

image,imagemagick

It is trivial to convert your data to "PBM" format, even with a text editor,as I've done here. Change all of the " 1" to "0", "-1" to "1", and add a one-line header "P1 8 8 1" (substitute the actual width and height for "8 8"). Here's a one-line...

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

pdf,imagemagick,ghostscript,imagemagick-convert

The minimally working example has PDF object no. 10 as an ObjStm (object stream), where this part can be found (I edited the whitespace formatting for improved readability): << /Type /Font /Subtype /Type0 /BaseFont /GAKHDJ+#28AH)#20Manal#20Black /Encoding /Identity-H /DescendantFonts [4 0 R] /ToUnicode 12 0 R >> So the font name,...

Unable to delete created and streamed file

c#,asp.net-web-api,imagemagick

I am assuming that the Image class that you are returning is a System.Drawing.Image. You need to Dispose this object to release the file lock. // Instead of this: using (MemoryStream ms = new MemoryStream()) { TheLocalSellerRepo.GetConvertedPDFImage().Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); base64 = System.Convert.ToBase64String(ms.ToArray()); } // Should you be doing this: using (MemoryStream...

php remove pixels border around an image

php,image,imagemagick,gd

imagecrop — Crop an image using the given coordinates and size, x, y, width and height http://php.net/manual/en/function.imagecrop.php Edit: example from the linked page, as requested. Modify to account for 10px border: <?php // Create a blank image and add some text $ini_filename = 'test.JPG'; $im = imagecreatefromjpeg($ini_filename ); $ini_x_size...

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

image-processing,command-line,imagemagick

You can do convert input.png -alpha off output.png If you want to do a whole hierarchy of files find . -name ".png" -exec convert "{}" -alpha off "{}" \; Please test on a COPY of your files to be sure. ... see dialog below, and the answer is based on...

Convert multiple images with ImageMagick

imagemagick

For Windows users -- you can try this in a cmd.exe window: for %i in (*.png *\*.png *\*\*.png *\*\*\*.png) do ( convert.exe %i %~pni---repaired.png ) This will loop through the current dir's PNGs as well as the ones in the sub directories 3 levels deep. You have to make sure...

Translate ImageMagick CLI to PHP Imagick API

php,api,imagemagick,command-line-interface,imagick

You should be able to do this: $img1->compositeImage( $img2, imagick::COMPOSITE_COPYOPACITY, 0, 0 ); $img1->compositeImage( $img2, imagick::COMPOSITE_MULTIPLY, 0, 0 ); Have a look at the documentation - here....

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

php,imagemagick

I am hopeless at PHP but something like this seems to work for me: #!/usr/local/bin/php -f <?php $padding=10; $info = getimagesize("input.jpg"); $width=$info[0]; $height=$info[1]; // Calculate dimensions of output image $canvasWidth=$width+4*$padding; $canvasHeight=$height+2*$padding; // create white canvas $output = imagecreatetruecolor($canvasWidth, $canvasHeight); $background = imagecolorallocate($output, 255, 255, 255); imagefill($output, 0, 0, $background); //...

Calculate the main memory consumption of ImageMagick convert when appending images

imagemagick,imagemagick-convert

It seems you are using the Q16 version of ImageMagick and this version of ImageMagick uses 16 bits per pixel channel (The Q8 version uses 8 bits per pixel). In ImageMagick 6 each pixel has 4-5 channels per pixel (red,green,blue,opacity, index), this behavior is going to change in ImageMagick 7...

Imagick Interprets external image as HTML

php,imagemagick,imagick

I strongly recommend not using Imagick for downloading images from other servers. Either use CURL or some other library that gives you adequate control over the download (including being able to see redirects, incorrect content types, etc), and then process the image with Imagick once it is downloaded correctly. Source...

GraphicsMagick using nodejs not returning correct image

css,node.js,image,imagemagick

Your input image is a GIF and has transparency. Your output file is a JPEG which cannot support transparency, so GraphicsMagick has rendered the transparent pixels as black - the default background colour. You have two choices: Store your image as GIF, or PNG which can represent transparency Change the...

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

cakephp,imagemagick

You can access each page by $im->readimage($uploadfile."[".$pageNumber."]"); With imagemagick you can also read how many pages there are in a pdf: $document = new Imagick('document.pdf'); $document->getNumberImages(); With this number you can iterate over each page and save an image. As stated here: http://php.net/manual/en/class.imagick.php#111197 the pointer of imagemagick is set to...

Magick++ not loading from blog

c++,imagemagick,physfs

Magick::Blob as a constructor needs a void*, in other words a memory location to read the data from. But you are providing pointer to a std::filebuf object and that won't work. You will have to read the file into memory. For example a char* and use that in the Blob...

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

imagemagick,mediawiki,graphicsmagick

ImageMagick offers lots of image manipulations not available via normal HTML/CSS operations. So for some tasks, your browser just can't do the modifications. One very important task is simply file size: if a user uploads a 20MB image you don't want to deliver that to your clients with a 3G...

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

amazon-ec2,parallel-processing,imagemagick,celery

Consider also the following points: You can do any processing of ImageMagick files completely in memory by "saving" any input image in the special format MPR: (Magick Pixel Register). For details see this answer: "ImageMagick multiple operations in single invocation" ImageMagick can access remote images via http://. You can put...

How to increase quality of image through imagemagick binary convert?

php,image,imagemagick,exec,imagemagick-convert

Think sharpen works like blur and takes an argument of {radius}x{sigma} What version are you using? Maybe look at some of the docs that correspond to it... http://www.imagemagick.org/Usage/blur...

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

c#,imagemagick,magicknet

You should call the Write method of the WritablePixelCollection class that is returned by image.GetWritablePixels() to make sure the pixels are written to the image. You could also do what you are doing in a different way: using (MagickImage image = new MagickImage()) { image.Read(@"C:\.....\test1.png"); image.Evaluate(Channels.Red, EvaluateOperator.Set, Quantum.Max); image.Write(@"C:\.....\test2.png"); }...

ImageMagick crashing for JPEG with incorrect density value

php,image-processing,imagemagick,dpi

Could your error be related to... For formats which do not support an image resolution, the original resolution of the image must be specified via -density on the command line prior to specifying the resample resolution. JPEG I know supports resolution but maybe its wrong in the EXIF header or...

Imagemagick convert tif to rgba16 png

imagemagick,png,tiff,imagemagick-convert

In general, ImageMagick will use the most economical output format that is compatible with your specifications. So, if your input image doesn't have an alpha channel (i.e. transparency), your output image won't have transparency. If a 256-colour palette is adequate for the colours in your image, it will create a...

RMagic gem require error. RMagick2.so cannot be opened

ruby-on-rails,ruby,imagemagick,rmagick

The issue you are facing is with the path - convert is located at /usr/local/bin/convert It should be located at /usr/bin/convert Remove the one under bin and reinstall it , and the issue will be solved ....

Rotate individual letters of the same word in ImageMagick

imagemagick,captcha

I think you need this: #!/bin/bash word="theId" for (( i=0 ; i<${#word} ; i++ )) ; do rotation=$(((RANDOM%10)*4)) # Generate random rotation for each letter convert -background none -virtual-pixel none -pointsize 72 label:"${word:i:1}" +distort SRT $rotation miff:- done | convert -background none - +append result.png Basically I am creating and...

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

Paper clip for windows 7 If you're using Windows 7+ as a development environment, you may need to install the file.exe application manually. The file spoofing system in Paperclip 4+ relies on this; if you don't have it working, you'll receive Validation failed: Upload file has an extension that does...

Find the first black pixel in every row with ImageMagick

imagemagick

You do NOT need subimage-search to achieve your goal. The problem can be reduced to text parsing. 1. Basics Consider this: you can tell ImageMagick to convert any image to a textual representation, which holds the exact color information for each individual pixel. Example: convert wizard: textwizard.txt      ...

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

java,imagemagick

I can get it to work, only if I change the working directory from which the executed is to be run, using ProcessBuilder#directory(File) ProcessBuilder pb = new ProcessBuilder( "C:\\Program Files\\ImageMagick-6.9.1-Q16\\convert.exe", "C:\\Path\to\Large.png", "-resize", "1027x768", "C:\\Path\to\small.png"); try { pb.inheritIO(); pb.redirectErrorStream(); pb.directory(new File("C:\\Program Files\\ImageMagick-6.9.1-Q16")); Process p = pb.start(); try (InputStream is = p.getInputStream())...

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

imagemagick,ocr,tesseract,imagemagick-convert

If you convert to JPEG, you will always have the type of artifacts you are seeing. This is a typical "feature" of JPEG compression. JPEGs are never good for images showing sharp lines, contrasts with uniform colors between different areas of the image, using only very few colors. This is...

TYPO3 6.2 scaling img using gifbuilder did't work

imagemagick,typo3,typoscript,yag

Probably this issue was posted on forge https://forge.typo3.org/issues/65378. If so, I think you should add your comments to the this thread. This will speed up reaction of TYPO3 team....

resize image to specific height and width value using im4java?

imagemagick,jmagick,im4java

I don't read or understand java much, but at the command-line you need an exclamation mark to force ImageMagick to disregard aspect ratio and resize to exact/specific dimensions, like this: convert -resize 300x200! image.... In the Java docs, there seems to be an option of adding a special 3rd parameter,...

Find edges (border of rectangle) inside an image

python,imagemagick,image-manipulation,edge-detection

You can do that with ImageMagick. There are different IM methods one can come up with. Here is the first algorithm which came to mind for me. It assumes the "sticky notes" are not tilted or rotated on the larger image: First stage: use canny edge detection to reveal the...

PHP Imagick crop image with negative offset and keep negative space

php,imagemagick,imagick

Use Imagick::extentImage after cropping to grow the image to the expected image size. Filling the "empty" pixels is easy with either setting the background color, or flood filling as needed. $width = 100; $height = 100; $x = -50; $y = -25; $image = new Imagick(); $image->readImage('rose:'); $image->cropImage( $width, $height,...

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

imagemagick

I assume you would like to lighten 2nd image so you get 3rd but without text. So from command line this should give same results: convert porsche.png -fill white -colorize 80% porshe_light.png ...

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

imagemagick

%d is not handled by bash, its handled by imagemagicks convert. You can specify the starting number using -scene, so you could do: subprocess.Popen(['convert -scene 1 '+document+' '+outFile+'_page%04d.tif'], stdout=subprocess.PIPE, shell=True).wait() ...

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

c,imagemagick

If you are providing a rectangle to colour in, why not just ignore a rectangular area in the first place? Here is some pseudo code int compareimages (char *im1, char* im2, int wid, int dep, int x0, int y0, int x1, int y1) { int x, y; for (y=0; y<dep;...

ImageMagick : get image width return undefined

javascript,node.js,imagemagick

Since easyimg.info(...) is asyncronous console.log(width); is run before you assign a value to variable width...

Finding shapes in an image using ImageMagick

image,image-processing,imagemagick,edge-detection,canny-operator

I am not sure I understand your question, but think I can maybe get you close to an answer! I would maybe generate your green and red files separately, but let's start with what you have got. If you convert your red and lime difference file to a black and...

Serving SVG as JPEG using Imagick and PHP

php,xml,svg,imagemagick,imagick

I finally found a combination that works. After a bit of struggle, I was finally able to get the below combination to work on my machine. OS: Windows 7 64 Bit PHP: 5.5.6 XAMPP: 1.8.3 Compiler: MSVC11 Architecture: x86 ImageMagick: ImageMagick-6.7.7-5-Q16-windows-dll (available here:http://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/binaries/) Imagick DLL: PHP5.5.x version from http://www.peewit.fr/imagick/ Note:...

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

python,imagemagick,png,psd,wand

This would work just well and fast for both read and write: # Convert a large PSD to small PNG thumbnail myImage = Image(filename="test.psd[0]") myImage.format = "png" myImage.sample(100, 100) myImage.save(filename="test.png") Because Wand is only reading 1 layer instead of all the layers inside the PSD. the key is to append...

Paperclip multiple spoof media type depending of 'file' version

ruby-on-rails,imagemagick,paperclip,paperclip-validation

For thoses having same issue, my solution to allows multiple mappings was just accepted by Paperclip. You just have to get the last version of it. https://github.com/thoughtbot/paperclip/commit/ea142d80eb2f87c5ce7597026a58cd873d9de3a3...

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

imagemagick,pdf-generation,image-resizing,imagemagick-convert

A3 is 11.69" x 16.53", so at 300 dpi, you need 3507x4959 pixels. So, if you do this: convert -quality 100% input.jpg -resize 3507x4959 output.pdf you will get this: identify -verbose output.pdf Image: output.pdf Format: PDF (Portable Document Format) Mime type: application/pdf Class: DirectClass Geometry: 3507x4959+0+0 Resolution: 72x72 Print size:...

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

image,matlab,imagemagick,jpeg

In Matlab, you can get the value of the quality factor of an image file with imfinfo (see the example). Edit: However, the Quality is given in the Comment field, which can be filled differently depending on the software(s) that processed / generated your image. A more reliable method for...

Carrierwave image resizing not working

jquery,ruby-on-rails,ruby,imagemagick,carrierwave

resize_to_limit gets in action only if image size if larger than specified. Read docs here: link You would be better off using resize_to_fil...

ImageMagick : Compose with results of multiple convert

imagemagick,imagemagick-convert

Kind of hard to help without seeing your images! I guess it will look something like this though: convert -gravity center \ \( $1 -alpha set -background none -vignette 0x0 )\ \ \( $2 -auto-orient -thumbnail 600x313^ -gravity center -extent 600x313 -region 100%x100% -fill "#256997" -colorize 72% )\ \ -compose...

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

php,image-processing,imagemagick

I think you can locate the shape pretty accurately with a simple threshold, like this: convert image.jpg -threshold 90% result.jpg and you can then do a Canny edge detection like this: convert image.jpg -threshold 90% -canny 0x1+10%+30% result.jpg The next things I would be looking at are, using the -trim...

Best image optimization technique for Rails

ruby-on-rails,ruby,image,optimization,imagemagick

I would recommend ImageMagick for this task. You can strip out the EXIF headers and other extraneous information to reduce the filesizes using -strip option. convert input.jpg -strip output.jpg Or use mogrify to do all images in one go like this mogrify -strip *.jpg You can also specify a lower...

ImageMagick code in Python script

python,operating-system,imagemagick

You can use subprocess.check_call, passing the args as a list: from subprocess import check_call check_call(["sudo","convert","imgIn.jpg", "-posterize","2","imgOut.jpg"]) check_call([ "sudo",'convert', 'imgIn.jpg', '-matte', '(', '+clone', '-fuzz', '57%', '-opaque', 'black', '-transparent', 'blue', ')', '-compose', 'DstOut', '-composite', 'imgOut.jpg']) You will have to run the script with sudo, if you want to pass the password also...

Magick++ to display an image with CGI

c++,imagemagick,cgi,jpeg,magick++

I think you are looking for blobs - Binary Large Objects. Basically, you create an image of type Image and a blob of type Blob. You populate your image either by reading from a file or generating your random data, then you write your image to the blob (to encode...

How can I create an ImageMagick montage without empty space?

imagemagick,montage

Your right in identifying the empty region having the same width of the largest image. This is caused by -tile 3x3 which assumes 3 images per row. At the bottom of Montage Usage there's a section dedicated to gaps in a montage image, and how it can be controlled with...

crop options in imagemagick?

imagemagick,im4java

I think the authours probably expect users to be familiar with the command-line version of ImageMagick... I don't know if this answer is correct, I am just assuming that it is related to the special operators available on the command line after the geometry/size settings. Some of these are: <...

Convert a directory of Kodak PhotoCD images into TIFF format

linux,imagemagick,batch-processing,image-conversion

This worked perfectly for me on a Bash command line: for file in *.pcd;\ do convert $file[6] -colorspace RGB "`basename $file .pcd`.tiff";\ done (This can all be typed onto a single line without the backslashes, but I've used the Bash backslash escape to break this long line into three, to...

Resizing the image with padding using convert on ubuntu

linux,image,imagemagick,image-resizing

You need to use -extent to set the size of the canvas directly after you have resized, and the newly created area will be filled with whatever you set the -background to. So, if you want the padding to be magenta, do this: convert image.png -resize 100x100 -background "rgb(255,0,255)" -extent...

Transparent PNG created in Imagemagick drawn as opaque in FFMPEG

ffmpeg,imagemagick,transparency

I suggest you prefix the output filename when using ImageMagick with PNG32: to force it to generate a 32-bit ber pixel image - i.e. 1 byte each for R, G, B and Alpha and hope that ffmpeg is happier with that. convert input.png -draw ... PNG32:output.png If you run identify...

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

image,unix,imagemagick,imagemagick-convert

I don't have 2 animated GIFs of the same length, so I'll just use two copies of this one: Let's look at the frames in there, with this: identify 1.gif 1.gif[0] GIF 500x339 500x339+0+0 8-bit sRGB 32c 508KB 0.000u 0:00.000 1.gif[1] GIF 449x339 500x339+51+0 8-bit sRGB 32c 508KB 0.000u 0:00.000...

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

c++,imagemagick,magick++

I think there is a Magick::Image.transparent method that should handle transparency assignment. #include <iostream> #include <Magick++.h> using namespace std; using namespace Magick; int main(){ Image my_image("objects.png"); Color bg_color = my_image.pixelColor(0,0); my_image.transparent(bg_color); my_image.write("new_objects.png"); } Edit To allow the Magick::Color's opacity to be respected. You need to enable the alpha channel of...

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

php,image,image-processing,imagemagick,hide

What you need is a face detection tool. For PHP, I know this script: https://github.com/mauricesvay/php-facedetection (Here is the detailed usage: http://www.codediesel.com/algorithms/face-detection-in-images-using-php/) Just for fun, take a look in Google's Algorithm for Maps License Plate Blur tool: http://static.googleusercontent.com/media/research.google.com/pt-BR//archive/papers/cbprivacy_iccv09.pdf...

How to find the brightest pixel?

imagemagick

HSV colorspace in IM is called HSB, so you can get a histogram of image.jpg in that way: convert image.jpg -colorspace HSB -format %c histogram:info:- You need to reverse sort the output according to the third column (= brightness) and then pick the first line, which can be achieved like...

Create two sizes of an image using one ImageMagick command

image,imagemagick,image-resizing

Yes, it is possible, using the -write option: convert 4096-by-3072px-120mb.tif -resize "1600x>" -strip -interlace Plane \ -write 1600px-wide-for-web.jpg -resize "1024x>" 1024px-wide-for-web.jpg which rescales the input image to 1600 pixels wide, writes it out, then rescales the result to 1024 pixels wide and writes that. It's important to write the images...

Python subprocess: pipe an image blob to imagemagick shell command

python,image,shell,imagemagick,subprocess

It is not subprocess that is causing any issue it is what you are passing to imagemagick that is incorrect,tostring() does get passed to imagemagick. if you actually wanted to replicate the linux command you can pipe from one process to another: from subprocess import Popen,PIPE proc = Popen(['cat', 'image.jpg'],...

I need to leave the biggest object in image

image-processing,imagemagick,object-detection

Like this with Connected Component Analysis convert objects.png -define connected-components:verbose=true \ -define connected-components:area-threshold=100 \ -connected-components 8 -auto-level output.png Objects (id: bounding-box centroid area mean-color): 0: 595x842+0+0 296.7,420.0 499414 gray(255) 7: 37x30+342+632 360.0,646.5 1110 gray(0) 3: 12x15+465+375 470.5,382.0 180 gray(0) 1: 23x12+439+332 447.9,335.4 150 gray(0) 6: 13x16+451+425 456.6,430.6 136 gray(0) The...

ImageMagick No decode delegate for this image format

php,ios,imagemagick,imagick

Seems that your ImageMagick PHP module does not support any image formats. Try to find other ImageMagick installation or install PHP from the scratch. Also - seems that there is already question/answer in SO about that...

CarrierWave/MiniMagick avatar not displaying

ruby-on-rails,ruby,imagemagick,carrierwave,minimagick

The answer to this , is that you should use image_tag current_user.avatar.url(:tiny) ...

matplotlib animation.save to animated gif very slow

python,matplotlib,imagemagick,animated-gif

Update Please read the original answer below before doing anything suggested in this update. If you want to debug this in some depth, you could separate the ImageMagick part out and identify for sure where the issue is. To do that, I would locate your ImageMagick convert program like this:...

ImageMagick move watermark from top left to bottom right?

php,imagemagick

You're setting the watermark at (3,3). You need to set it in the bottom right by placing these numbers accordingly. Methodology: Calculate width and height on $im [$im_height, $im_width] Calculate width and height of $watermerk [$wm_height, $wm_width] Find the coordinates to place the watermark at via calculation of differences in...

Nodejs image crop by coordinates

node.js,image,imagemagick,crop

I don't speak node, but can you use the raw interface? It'll look something like im.convert(['inputimage.jpg','-crop','350x200+x+y','output.jpg'], function(...) put in your own numbers for x and y....

Get position of one image in another image

node.js,image,image-processing,imagemagick,frontend

I have a few suggestions that you might consider for speeding up your search if you are finding subimage search too slow. 1. Reduce the Image Size I conducted a little experiment to test searching for variously sized needles in variously sized haystacks, like this: #!/bin/bash # Create a range...

Share ImageMagick files over network drive without users installing ImageMagick?

python,imagemagick,install

Your best chance to achieve that is to share the portable version of ImageMagick. Look up ImageMagick portable on Google, download the files and put them on a share.

Compositing premultiplied images using ImageMagick

imagemagick,premultiplied-alpha

It would be easier if you showed your images, but try adding -compose lighten before -composite in your command, like this: convert a.tga b.tga -compose lighten -composite out.tga Basically that will make ImageMagick choose the lighter pixel of the two images at every point. If that doesn't work, try other...

How to create transparent image for rubber stamp in ImageMagick

imagemagick,imagemagick-convert

Updated Answer Ok, I got that wrong! You want to create a stamp overlay, not overlay a stamp overlay. You can do that like this: # Create white square, draw a black rectangle, then make black pixels transparent convert -size 300x300 xc:white \ -fill black -draw "rectangle 20,100 200,280" \...

convert and crop image in tiles with python

python,imagemagick,crop,imagemagick-convert,wand

Python's wand library offers a unique crop alternative. Using wand.image.Image[left:right, top:bottom] can sub-slice a new virtual pixel image. from wand.image import Image with Image(filename="big_image.jpg") as img: i = 0 for h in range(0, img.height, 256): for w in range(0, img.width, 256): w_end = w + 256 h_end = h +...

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

imagemagick

Endian can be controlled with -endian option. Example. Create a 2x2 red PFM image with little endian, and write to hexdump. $ convert -size 2x2 xc:red -endian LSB PFM:- | hexdump 0000000 50 46 0a 32 20 32 0a 2d 31 2e 30 0a 00 00 80 3f 0000010 00...

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

bash,imagemagick,runtime,imagemagick-convert,mogrify

A few things spring to mind... Firstly, don't start ImageMagick twice per image, once to resize it and once to crop it when it should be possible to do both operations in one go. So, instead of your two convert commands, I would do just one convert image.jpg -resize 1920x1440...

How to speed up a complex image processing?

php,image,imagemagick,converter,imagemagick-convert

0. Two approaches Basically, this challenge can be tackled in two different ways, or a combination of the two: Construct your commands as clever as possible. Trade speed-up gains for quality losses. The next few sections discuss the both approaches. 1. Check which ImageMagick you've got: 'Q8', 'Q16', 'Q32' or...

Dynamic alteration of graphic/canvas/divs

php,css3,svg,graphics,imagemagick

I think that transforms can give you everything that is needed div { transition: all 1s; } .base { height: 200px; width: 100px; border: solid 1px black; left: 50px; top: 100px; position: absolute; perspective: 100px; } .side { width: 100%; height: 50px; border: solid 1px red; position: absolute; } #side1...

Zoomming into an image with ImageMagick

image,imagemagick

The way to do this, apparently, is with the -distort option: convert -distort SRT '1.1 0' +repage test.png 2.png where 1.1 is a 110% zoom and the 0 is a rotation angle....

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

imagemagick,graphicsmagick

I think this is what you want: gm convert 61I23.png -operator matte negate 1 result.png ...

Compare images and remove duplicates

image,compare,imagemagick,png

You don't say if you are on OSX/Linux or Windows, however, I can get you started. ImageMagick can calculate a hash (checksum) of all the pixel data in an image regardless of date or timestamp like this identify -format "%# %f\n" *.png 25a3591a58550edd2cff65081eab11a86a6a62e006431c8c4393db8d71a1dfe4 blue.png 304c0994c751e75eac86bedac544f716560be5c359786f7a5c3cd6cb8d2294df green.png 466f1bac727ac8090ba2a9a13df8bfb6ada3c4eb3349087ce5dc5d14040514b5 grey.png 042a7ebd78e53a89c0afabfe569a9930c6412577fcf3bcfbce7bafe683e93e8a hue.png...

memory problems with imageMagick?

windows,imagemagick,imagemagick-convert,color-palette,hdd

Just some general advice really on dealing with problems with ImageMagick and large images. If you are dealing with images that are tens of thousands of rows by tens of thousands of columns, that can pretty soon mount up and exceed the limits of a 32-bit OS and ImageMagick binary,...

Are PDF dimensions meaningful when measured in pixels?

pdf,image-processing,imagemagick,pixel,dimensions

'Wand' and 'GDAL' are not made to process PDFs If you rely on Wand (ImageMagick bindings) to process PDFs, you are not using ImageMagick as you may imagine. Because ImageMagick cannot process PDFs by itself -- it only processes raster images. For other formats IM has to rely on 'delegates'....

Imagemagick crop while keeping size

imagemagick,imagemagick-convert

I think you need this to chop 10px off the top edge: convert rose: -chop 0x10 result.gif Just for completeness, if you want to chop 10px off the bottom, do this: convert rose: -gravity south -chop 0x10 result.gif And to chop 10px off the left edge: convert rose: -chop 10x...

Install Perl Image::Magick on Fedora

perl,imagemagick

The problem is that CPAN doesn't know about non-Perl dependencies. The Perl Image::Magick module is just a wrapper around a C library. You'll need that library installed before you can build the Perl module. $ sudo yum install ImageMagick It also probably need ImageMagick's development package. $ sudo yum install...

How to apply pagecurl effect on a static image by PHP

php,imagemagick,page-curl

I would apply this effect using an overlay image (probably a PNG with alpha) - this could be done either using ImageMagick or in the rendering layer (e.g. HTML/CSS etc) For PHP/Imagick extension, the Imagick::mergeImageLayers method is probably useful....

Photoshop script to export layer combinations

imagemagick,photoshop,photoshop-script

I think I have got the idea of what you want. I find ExtendScript pretty awkward to code in and would tend to do automated stuff outside of Photoshop with more powerful, everyday tools. I would go with ImageMagick and bash. ImageMagick is free and available for Windows, and the...

I can't convert with ImageMagick

php,centos,imagemagick

First of all, two observations: The message you see is not from ImageMagick, it is from Ghostscript. The message is not an error message, but merely a warning. So it may well be that your conversion did work and you'll have the desired output in $image_path. Did you check? Then,...

ImageMagick command without intermediary file fails

imagemagick,imagemagick-convert

Your link to the Example page does not lead me to what you possibly used as your template (stating it's "95% same as the example"). However, after some reformatting for better readability, for removing a typo and for adaption to my own environments (which needs the " (...) " parts...

easyimage : set re-sized image background to transparent

javascript,node.js,imagemagick,alpha-transparency

EasyImage does not support transparency. It passes the background color to ImageMagick via the -background flag, which does not do transparency. To use transparency in ImageMagick you need to use the -transparent flag, which EasyImage does not include in its options.