imagemagick-convert

ImageMagick change image width and height

依然范特西╮ 提交于 2019-12-04 16:40:21
I am using ImageMagick to resize image resolution by using below command-line option convert abc.png -set units PixelsPerInch -density 75 abc_a.png I am in need of this: if any images has more than 300 width OR more than 100 height, I want to convert it to width 300 width and 100 height, with changing above dpi (i.e. 75dpi). Can any one help me on this? If you are on Linux/OSX, you can get the image dimensions like this: identify -format "%w %h" input.jpg So, if you want the width and height in variables w and h , do this: read w h < <(identify -format "%w %h" input.jpg) Now you can test the

How to write text with angle orientation in ImageMagick?

☆樱花仙子☆ 提交于 2019-12-04 15:18:29
is it possible to use web fonts to write some text over the image with a particular angle orientation, and which command should I use? Guess it for example a text going from a left bottom corner to the right top corner. Here the working example code, that needs to be orientated: convert -size 600x357 xc:none -draw "image Over 0,0 0,0 'background01.jpg'" \ -pointsize 30 -font "geometricslab703bt-bold-webfont.ttf" -fill White \ -draw "text 140,175 'mijn ideale'" -append +repage \ result.jpg emcconville You'll need to copy your TTF font file into a path your ImageMagick install is looking for

ImageMagick single convert command performance

一世执手 提交于 2019-12-04 12:20:24
I have a few thousand images to be processed so each millisecond counts. Each image is ~2-3Mb in size. Source file fed to the converter: image.jpg Files to be generated out of the source: orig_image.jpg // original image 1024x768_image.jpg // large image 250x250_image.jpg // thumbnail 1 174x174_image.jpg // thumbnail 2 While browsing different topics on imagemagick convert performance I got a feeling that a single command should be way faster than individual converts for each image size. Also a memory utilization was mentioned as a performance boost. ( ImageMagick batch resizing performance )

ImageMagick with Visual Studio

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 11:54:04
I'm trying to write a sample ImageMagick program in Visual Studio 2010. I have binary distribution of ImageMagick already installed on my system as I can use command line interface of ImageMagick. However, when I try to include "Magick++.h" in my C++ program, it says it can't open source file. I found the instructions on compiling and building ImageMagick from source, but is it possible to change my visual studio project settings so it can pick necessary references/libraries from the already installed version of ImageMagick? I am by no means an expert, but here is what worked for me: Using

Detect if image is grayscale or color using Imagick

天涯浪子 提交于 2019-12-04 07:31:36
I'm attempting to try and assign a value to an image based on its 'saturation level', to see if the image is black and white or color. I'm using Imagick, and have found what seems to be the perfect code for the command line and am trying to replicate it using the PHP library. I think I understand the concept: Convert image to HSL. Extract the 'g' channel (which is the S channel in HSL). Calculate the mean of this channel. Command line code convert '$image_path' -colorspace HSL -channel g -separate +channel -format '%[fx:mean]' info: My PHP code $imagick = new Imagick($image_path); $imagick-

How to adjust jpeg quality with Magick.Net

こ雲淡風輕ζ 提交于 2019-12-04 01:54:49
I am trying to set the image quality of two images appended to one another to 10% and resize the images to 40x40. using (var images = new MagickImageCollection {designFile, swatchFile}) { MagickImage sprite = images.AppendHorizontally(); sprite.Format = MagickFormat.Jpeg; sprite.SetOption(MagickFormat.Jpeg, "quality", "10%"); sprite.SetOption(MagickFormat.Jpeg, "size", "40x40"); ; sprite.Write(spriteFile); } Unfortunately the SetOption and Format calls don't seem to be affecting the file that is written to sprite.Write() ? dlemstra The method SetOption is the same as -define in ImageMagick.

running imagemagick convert (console application) from python

你说的曾经没有我的故事 提交于 2019-12-03 22:08:31
问题 I am trying to rasterize some fonts using imagemagick with this command which works fine from a terminal: convert -size 30x40 xc:white -fill white -fill black -font "fonts\Helvetica Regular.ttf" -pointsize 40 -gravity South -draw "text 0,0 'O'" draw_text.gif Running the same command using subprocess to automate it does not work: try: cmd= ['convert','-size','30x40','xc:white','-fill','white','-fill','black','-font','fonts\Helvetica Regular.ttf','-pointsize','40','-gravity','South','-draw',

ImageMagick convert and GNU parallel together

回眸只為那壹抹淺笑 提交于 2019-12-03 16:14:40
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. 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 gives the number of jobs to run in parallel. I just created 100 PNG s of 10,000 x 8,000 and resized them to 2

How can I create a YUV422 frame from a JPEG or other image on Ubuntu

喜你入骨 提交于 2019-12-03 16:08:10
I want to create a sample YUV422 Frame on Ubuntu from any image so I can code a YUV422 to RGB888 function for the sake of learning. I'd really like to be able to use a trusted tool to create a sample and convert back to a jpeg. I've tried ImageMagick but am clearly doing something wrong: convert -size 640x480 -depth 24 test.jpg -colorspace YUV -size 640x480 -depth 16 -sampling-factor 4:2:2 tmp422.yuv convert -colorspace YUV -size 640x480 -depth 16 -sampling-factor 4:2:2 tmp422.yuv -size 640x480 -depth 24 -colorspace RGB test2.jpg I've also install the mpegtools package on Ubuntu, in order to

Creating a semi-transparent PNG with ImageMagick on Centos Linux

老子叫甜甜 提交于 2019-12-03 13:12:18
问题 I have PNG files that I would like to convert the whole image to be semi-transparent. The image will be referenced in a KML file as an icon overlay for use in Google Earth/Maps. The following examples have been suggested to me using the ImageMagick convert command, however neither seems to work. The first example results in an error, the second example fails to make any observable change to the image. $ /usr/local/bin/convert 121112142121.png -channel Alpha -evaluate Set 50% 2121112142121.png