ImageMagick

Imagick - no decode delegate for this image format

北战南征 提交于 2019-12-23 04:45:21
问题 I am trying to convert PNGs to GIF using ImageMagick on my Ubuntu server. I used a PHP code to generate it however when I ran it, I received.. PHP Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format Then I used: convert -list configure , on the libs, I didn't see either gif or png. So I researched a bit more, and found that I should

RMagick returns nil reading JPEG

荒凉一梦 提交于 2019-12-23 04:43:07
问题 When I try to open a JPEG format file in Rails using RMagick, it always return nil with any jpg file. Other file formats open well. $ script/console Loading development environment (Rails 2.3.4) >> require 'RMagick' >> img = Image.read("1.gif").first => 1.gif GIF 230x100 230x100+0+0 PseudoClass 256c 8-bit 2kb >> img = Image.read("1.png").first => 1.png PNG 1280x800 1280x800+0+0 DirectClass 8-bit 156kb >> img = Image.read("1.jpg").first => nil Why this happens? 回答1: Do you have the jpeg

Need help understanding the ImageMagick/Graphicsmagick -colors option

孤街浪徒 提交于 2019-12-23 04:22:15
问题 I am trying to programmatically reduce (lossy) the file size of PNG and GIF files. As part of this I need to reduce the number of colors in the images. I don't want to reduce all the images to a single colors value, so what I am doing is; get the number of unique colors in the image, then; divide this number by 2 to reduce the number of colors by half. The problem is this does not work. Using ImageMagic it is way too slow and doesn't reduce the file size unless the image has under a few

Scale down images effectively without losing aspect ratio or quality in php

我的未来我决定 提交于 2019-12-23 03:19:37
问题 I am about launch my biggest dream website(my first one), but have some unresolved issues. I am a complete newbie to coding and highly rely on plugins and tutorials to get stuff done. Now, I am facing problems in handling images and I have tried a lot of options to solve these issues, but not found any perfect solution. I have a feature where users can create their own profile, upload profile pic and a cover pic, re-position it and save it(somewhat like facebook). And also they can update

How to use Fred's ImageMagick textcleaner script?

馋奶兔 提交于 2019-12-23 03:02:12
问题 I want to do OCR on some of my images, but images are not quite very impressive. So, for cleaning it I wanted to use Fred's ImageMagick Textcleaner script. Command that I gave:- sh textcleaner.sh input_file output_file -g -e stretch -f 25 -o 20 -t 30 -u -s 1 -T -p 20 This is the arguments which Fred has given on website itself. I am also doing for same sample image. But I don't think so any of my options are working everything is by default. And I keep getting this error also textcleaner.sh:

Make part of an image transparent with IMagick/ImageMagick

佐手、 提交于 2019-12-23 02:55:08
问题 I wish to make part (or in fact, several parts) of an image transparent using IMagick, such that I can use it as a mask over a different image. I can't figure out any way of doing this in an simple fashion. So say my starting image is represented as below, where X is any color: XXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXX Then I want to be able to make certain rectangular regions transparent (so it ends up a bit like a punch-card): XXXXXXXXXXXXX X XXXXXXXXXX X XXXX

How to use ImageMagick to batch desaturate images?

旧时模样 提交于 2019-12-23 02:41:21
问题 I have an image that is black text with some gray and pale yellowish background. I basically want to keep the text as black as possible, and make the gray and yellow comparatively lighter...at the very least, turn yellow into a light gray. What's the most efficient way to do that in ImageMagick? 回答1: Answering the title question: you can batch desaturate images with the options -colorspace Gray OR -type Grayscale OR -modulate 100,0 - reference here: the options don't work identically Sample

Creating a collage from a collection of images in Ruby

a 夏天 提交于 2019-12-23 02:00:17
问题 I have a collection of images that have been laid out in a rectangle to look like a collage. How can I take those images and create a single image out of them in Ruby? For example I have three images that I want placed in the image as follows: Image 1: (0,0) - (300,400) Image 2: (350, 0) - (500, 200) Image 3: (350, 220) - (500, 400) 回答1: You can try something like this with RMagick: require 'RMagick' bg = Image.read('bg.png') # may be a background image... image1 = Image.read('image1.png')

How to get RGB values using JMagick?

倖福魔咒の 提交于 2019-12-23 01:53:18
问题 How to get RGB values using JMagick(a wrapper of imagemagick) ? 回答1: If you want to get the "red" value of a specific image, on the commandline, you could use the following syntax. For the JMagick API, just look up how you'll have to translate this into API calls: identify -format "%[fx:s.p{111,111}.r]" input.jpg 0.427451 fx: is ImageMagick's special effects image operator that allows you to query all sorts of properties from an image, use them in a mathematical expression and apply them on

How to make transparent background white instead of black when converting PDF to JPG using PythonMagick

给你一囗甜甜゛ 提交于 2019-12-22 18:00:03
问题 I'm trying to convert from PDF to JPG using PythonMagick, but I can't find a way to set the background color, which by default is changed from transparent to black. I can get the desired result using os.system and the -flatten parameter as shown below. import os os.system('convert -flatten -background \#ffffff -density 400 -adaptive-resize 1900x infile.pdf outfile.jpg') However, PythonMagick does not seem to have a flatten method and the following snippet produces an image with a black