imagemagick-convert

Frames not disappearing in python wand

核能气质少年 提交于 2019-12-11 15:59:38
问题 As per hint from here, I tried to create a gif with 2 dissimilar images as below. It works, but one frame is not disappearing to show another frame. Why would this happen and how to rectify? from wand.image import Image as Image2 with Image2() as wand: # Add new frames into sequance with Image2(blob=d2) as one: wand.sequence.append(one) with Image2(blob=d3) as two: wand.sequence.append(two) # Create progressive delay for each frame for cursor in range(2): with wand.sequence[cursor] as frame:

Average image color excluding transparency with Imagemagick

荒凉一梦 提交于 2019-12-11 15:37:42
问题 Using IM's CLI, I'm trying to get the average image color for an image, excluding any transparent pixels. The normally used -resize 1x1 info:- is not useful in this case, as obviously transparent pixels will affect the result (and you end up with a totally transparent pixel in some cases) My fallback right now is extracting them using -define histogram:unique-colors=true -format %c histogram:info:- and manually excluding the transparent ones, but this feels complex for something IM might

ImageMagick script to resize folder of images

℡╲_俬逩灬. 提交于 2019-12-11 12:54:53
问题 I have a folder of images of varying sizes and quality. Is there a way with ImageMagic that I could automatically resize them to be no bigger 1100px x 1100px and less than 160kb. And not to re-size if they are smaller than those parameters. Also not to distort the image so it fits within but to only re-size so for example an image which is 2200px by 1000px would become 1100px by 500px. I'm working on Ubuntu with ImageMagick 6.7.7-10. 回答1: Try this on a copy of your files: mogrify -define jpeg

ImageMagick not applying svg filters while converting to png

北慕城南 提交于 2019-12-11 12:18:17
问题 Can someone help identify the problem here. Consider this SVG markup. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="446.5 158 967 368"> <defs> <filter color-interpolation-filters="sRGB" id="Sil2df3ui1g5" filterUnits="userSpaceOnUse"> <feGaussianBlur stdDeviation="2" in="SourceAlpha"/> <feOffset result="offsetblur" dy="10" dx="10"/> <feFlood flood-color="orange"/> <feComposite operator="in" in2="offsetblur"/>

command line arguments fed from an array

醉酒当歌 提交于 2019-12-11 11:45:55
问题 I'd like to perform a complicated bash command, using data fed from a long array as arguments. I guess it has to use a subshell in some way. For example, instead of the workable convert -size 100x100 xc:black -fill white -draw "point 1,1" -draw "point 4,8" -draw "point 87,34" etc etc etc image.png I want to employ a different logic where the arguments are given in the same command, more like convert -size 100x100 xc:black -fill white $(for i in 1,1 4,8 87,34 etc etc; -draw "point $i"; done)

Execute ImageMagick convert in subfolders with Bash script

左心房为你撑大大i 提交于 2019-12-11 11:16:45
问题 I have multiple series of jpegs. Each series is in its own folder. I wish to convert each series into a single pdf. I would further like the pdf to have the same name as the folder it is in. To do this on the command line in each folder I can use the following command: convert *.jpg `echo ${PWD##*/}`.pdf I would like to do it from the top level folder with a bash script. 回答1: You might want to use find for this: find . -type d -exec bash -c 'cd "$0" || exit; shopt -s nullglob; f=( *.jpg ); ((

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

人盡茶涼 提交于 2019-12-11 11:07:15
问题 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 powerful beasts to do this job, namely, ImageMagick and Ghostscript . All what I need is to convert one text PDF to image PDF in one go, preferably with batch processing if possible (to convert many PDFs in one go). I run this code in command line and it

Extracting icons with imagemagick creates black stripes on transparency

僤鯓⒐⒋嵵緔 提交于 2019-12-11 09:28:07
问题 For a project of mine I'm fetching websites favicons and storing them to be displayed in a website. Sounds pretty trivial, but I have one strange issue. Almost all icons come in a .ico format, which is not very web friendly. Some icons also have different sizes in them. I'm using Imagemagick to convert them to PNG and extract only the 16x16 icon. I'm using the following command line for this: convert source.ico -geometry 16x16 -alpha on -background none -flatten out.png Unfortunately on some

Drawing centered rectangle with ImageMagick

ⅰ亾dé卋堺 提交于 2019-12-11 07:58:13
问题 Using the CLI, I'd like to add a black rectangle to an image that is 1) centered and 2) X pixels from every edge. Basically, I almost want the opposite of -border (instead of adding a border of a certain color, I'd like to keep X pixels of my image as border, then paint everything else inside black. Also, image size should not change). Something that I expected to work but didn't was: convert myImage.jpg -fill black -draw "rectangle 10,10 %[fx:w-20],%[fx:h-20]" outImage.jpg ...for a "border"

ImageMagick Conversion from .ps to .png, run from python - invalid param

谁都会走 提交于 2019-12-11 04:07:01
问题 I have been looking through some similar posts and through the ImageMagick page, but I cannot seem to find a reason for my issue: Note I am using a windows machine. I have a .ps image in a folder and it works when running with the command to convert it from the cmd: convert saved.ps newsaved.png However when I try to execute it from my python script with the following code: args = ["convert","saved.ps newsave.png"] subprocess.Popen(args) #or this call(args) os.system("start newsave.png") The