imagemagick-convert

Use two different fonts in imagemagick on one line

六月ゝ 毕业季﹏ 提交于 2019-12-09 02:10:26
问题 So i want to draw on my image text lets say in this example "Trevor, 24" But I want to use the font Helvetica for Trevor, and for 24 i want to use the font Arial. But I want it to be on the same line and look like it's one. Is it possible or how would i go about making it so that even if i change the name and age, that i can print it out like this? "Trevor, (Helvetica) 24(Ariel)" I would assume to print them next to eachother, but if someone enters the name longer than Trevor 24 would go over

Imagemagick: replace alpha pixel with color-shade pixel

蹲街弑〆低调 提交于 2019-12-08 20:47:29
In previous question I made false assumption that I need to remove pixels with alpha, but I actually need to use alpha percentage as shade of white. Because just removing alpha-pixel changes lines. But as background is to be white. Image btn_bg_common_press.9.png becomes I also looked at ImageMagick, replace semi-transparent white with opaque white and found that I can do with convert icon.png -channel A -fx "(a>0.5) ? 1.0 : 0" output.png Though that is still rough. 来源: https://stackoverflow.com/questions/28939645/imagemagick-replace-alpha-pixel-with-color-shade-pixel

Using ImageMagick's “convert” utility as a Python subprocess

风格不统一 提交于 2019-12-08 10:17:33
问题 I'm looking to convert a large directory of thumbnails. Instead of using the PythonMagick wrapper I'd like to access the convert binary directly (I have a lot of flags, and think this would be more efficient for a large quantity of photos.) Are there any working examples of using ImageMagick as a subprocess? Or, is there a better way to do this? Specifically, I'm not sure how to start and end a Python subprocess from within a class. My class is called ThumbnailGenerator. I'm hoping to make

Gray scale image to color

柔情痞子 提交于 2019-12-08 08:14:56
问题 Is there a way to convert a gray-scale image to a colour image? Here's a few JPG examples Photo 1 Photo 2 Photo 3 ImageMagick is powerful but doesn't seem capable of converting to a colourful version. 回答1: Unfortunately this is not possible. Grayscale images do not contain sufficient information to create a color image. In instances where you see B&W/Grayscale images converted to color, this has been done manually in an application such as photoshop. You can use imagemagick to apply a filter

Executing bash convert commands asynchronously

笑着哭i 提交于 2019-12-08 06:43:02
问题 I have a loop that cycles through a bunch of images that I need to edit with Imagemagick. Trouble is, it's slow to have to wait for each image to be edited before editing the next one. I want to execute each of the convert commands asynchronously not waiting for the last one to finish.Is this possible with bash? Here's a basic overview of what I have: for img in * do convert $img **more params here** done I want to execute that convert command asynchronously. So I can convert all the images

How to do four point distort with Imagemagick

人盡茶涼 提交于 2019-12-08 06:01:43
问题 I want to place a logo on a image. I have 4 (x,y) coordinates. The logo should be placed between this area only with some skew effect as given below. 回答1: It is always best to provide clean separate input imagery (in a addition to your result) and your ImageMagick version and platform. Nevertheless, I cropped out the two images as: Then I measured the corner coordinates of the G image clockwise from the top left corner. Then I measured the colored circle coordinates in similar order (green,

Imagemagick: replace alpha pixel with color-shade pixel

◇◆丶佛笑我妖孽 提交于 2019-12-08 04:44:42
问题 In previous question I made false assumption that I need to remove pixels with alpha, but I actually need to use alpha percentage as shade of white. Because just removing alpha-pixel changes lines. But as background is to be white. Image btn_bg_common_press.9.png becomes I also looked at ImageMagick, replace semi-transparent white with opaque white and found that I can do with convert icon.png -channel A -fx "(a>0.5) ? 1.0 : 0" output.png Though that is still rough. 来源: https://stackoverflow

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

让人想犯罪 __ 提交于 2019-12-07 17:54:04
问题 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 about 17 minutes for me to crop and resize 750 images. I have a total of about 300,000 to deal with, and will probably be doing then in batches of about 50,000. That is 18 hours 45 minutes per batch, and over 4.5 days of computing total. So

Difference between caption, draw, annotate, label while adding text to ImageMagick

我们两清 提交于 2019-12-07 16:29:07
问题 I'm trying to add text to an image using ImageMagick. I see multiple examples using draw, label, caption, annotate et al. What is the difference between the above? I am able to test the results of the above commands with CLI, however am facing trouble when trying to run by java using IM4java. Any help with java code snippets will be useful. 回答1: Here is how I perceive it - it is quite opinionated and others are welcome to edit and add their insights. label: Like other operators that contain a

imagemagick wand save pdf pages as images

不羁的心 提交于 2019-12-07 15:46:41
问题 I would like to use imagemagick Wand package to convert all pages of a pdf file into a single image file. I am having the following trouble though (see comments below which highlight problem) import tempfile from wand.image import Image with file('my_pdf_with_5_pages.png') as f: image = Image(file=f, format='png') save_using_filename(image) save_using_file(image) def save_using_filename(image): with tempfile.NamedTemporaryFile() as temp: # this saves all pages, but a file for each page (so 3