ImageMagick

Compress image quality (from 4MB to 2MB) without losing its dimension

一个人想着一个人 提交于 2019-12-22 17:52:40
问题 I am trying to compress the quality of an image using ImageMagick . I mean that I have an image which dimension is 1600X800 and size is 4MB . Now I am trying to compress the quality of this image into 2MB without resizing its dimensions, means the newly generated image also have the same dimension as actual image (i.e. 1600X800) but the quality of this image should be compress into 2MB ( half of the actual image ). For this, now I am using the below code, but this is not compress the size of

fabric js or imagick remove white from image

旧巷老猫 提交于 2019-12-22 14:48:09
问题 I got this situation which is hard for me to search on Google and explain. Our company prints photos on aluminium and we give our customers two choices. The first choice is to print their pictures on aluminium just like they gave the picture to us, so if the picture has a white background the picture gets printed with a white background. Easy like that. The second option is that we can print their picture without using white. instead of all the "white values" (<- the best I can come up with

imagemagick convert.exe error

僤鯓⒐⒋嵵緔 提交于 2019-12-22 13:59:03
问题 My code to convert planets.png to planets.jpg <?php exec("convert planets.png planets.jpg"); ?> Which is not working just showing blank page. i have installed imagemagick as it is showing in phpinfo() View here Is here any other configuration remaining to run that imagemagick code. Error message [Sat Jul 28 20:16:11 2012] [error] [client 127.0.0.1] PHP 1. {main}() D:\\wamp\\www\\test\\into.php:0 Invalid Parameter - planets.jpg 回答1: This is why is important to have the error message. With it

Resizing an image w.r.t to its height and width

我与影子孤独终老i 提交于 2019-12-22 12:54:26
问题 I need to resize an image so that if its height is smaller than its width, I'll set its height and vice versa. I wonder if there's a way doing this directly from the command line. Using '^' operator behaves just the opposite (or I could not succeed using it for my purpose). Thanks for replies. 来源: https://stackoverflow.com/questions/9003490/resizing-an-image-w-r-t-to-its-height-and-width

Node js + imagemagick + Error: spawn ENOENT

橙三吉。 提交于 2019-12-22 12:39:26
问题 Hi am trying to implement Imagemagick package using node.js I added my following code. var im = require('imagemagick'); router.post('/conversation/start', function(req, res) { var args = ["/public/images/team/rajini.jpg", "-crop", "120x80+30+15", "output.png"]; im.convert(args, function(err) { if (err) { throw err; } res.end("Image crop complete"); }); }); But i getting the following error in terminal. events.js:72 throw er; // Unhandled 'error' event ^ Error: spawn ENOENT at errnoException

Use exiv2 or imagemagick to remove EXIF data from stdin and output to stdout

淺唱寂寞╮ 提交于 2019-12-22 12:22:33
问题 How can I pipe an image into exiv2 or imagemagick, strip the EXIF tag, and pipe it out to stdout for more manipulation? I'm hoping for something like: exiv2 rm - - | md5sum which would output an image supplied via stdin and calcualte its md5sum. Alternatively, is there a faster way to do this? 回答1: Using exiv2 I was not able to find a way to get exiv2 to output to stdout -- it only wants to overwrite the existing file. You could use a small bash script to make a temporary file and get the md5

Watermark images with paperclip, rails 4

╄→尐↘猪︶ㄣ 提交于 2019-12-22 10:43:39
问题 I've been attempting to add watermarks to my images, following the answer listed in watermark with paperclip : Watermark.rb: module Paperclip class Watermark < Processor # Handles watermarking of images that are uploaded. attr_accessor :current_geometry, :target_geometry, :format, :whiny, :convert_options, :watermark_path, :watermark_offset, :overlay, :position def initialize file, options = {}, attachment = nil super geometry = options[:geometry] @file = file @crop = geometry[-1,1] == '#'

encoding error displaying fontawesome with imagemagick

早过忘川 提交于 2019-12-22 10:39:23
问题 i'm trying to use fontawesome with imagemagick to display it's character as png , here is my code: $size = '50'; $text = ''; $imgW = 200; $imgH = 200; $font = 'fontawesome-webfont.ttf'; $image = new Imagick(); $image->setResolution(144,144); $draw = new ImagickDraw(); $draw->setFont($font); $draw->setFontSize($size); //$draw->setTextEncoding('UTF-8'); //$draw->setStrokeAntialias(true); //$draw->setTextAntialias(true); $image->newImage($imgW, $imgH, new ImagickPixel('none')); $image-

ImageMagick and imagick_type_gen don't recognize added fonts

喜你入骨 提交于 2019-12-22 09:19:43
问题 Ok, I'm running a CentOS server, PHP 5.4.440 and ImageMagick 6.5.4 and I'm trying to add additional fonts, as an example let's say Lobster. Here's what I've done so far: Uploaded Lobster.ttf to /home/myusername/fonts/ From SSH, ran "perl imagick_type_gen > fonts.xml". This resulted in a large font file, but contained NO references to either Lobster.otf or Lobster.ttf Instead, I generated my own type.xml and saved it to /home/myusername/.magick/. Here's the markup: <?xml version="1.0"?>

RMagick transparency not working when compositing one image over another

北战南征 提交于 2019-12-22 09:17:56
问题 In the following code I'm trying to overlay a transparent square over the image of some mountains. I thought it would work, but by setting background_color = 'none' it doesn't make the image transparent! The result is a black square over the top left corner - desired result is the black square should be transparent. require 'open-uri' require 'RMagick' image_url = 'http://farm9.staticflickr.com/8446/7937080514_62d7749860.jpg' bg = Magick::ImageList.new open(image_url, 'rb') do |f| bg.from