graphicsmagick

Node.js: Error: spawn ENOENT while using GM module

那年仲夏 提交于 2019-12-13 15:06:25
问题 Even though this has been asked several times, none of the existing answers helped me out. Using a MEAN environment (on Mac OSX), I installed graphicsmagick using: sudo npm install gm Whenever I run the following script, I get this error: { [Error: spawn ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn' } This is the piece of code I am trying to run: var gm = require('gm'); //var gm = require('gm').subClass({ imageMagick: true }); //tried this one too gm('./project/public/images

GraphicsMagick getting “Stream yields empty buffer error” on Elastic Beanstalk

孤街醉人 提交于 2019-12-13 07:11:50
问题 I am using GM for very simple thing: drawing a circle and put it in buffer. But after I check the code into Elastic Beanstalk, I am getting the "Stream yields empty buffer error" error. I am not sure why because it totally works on localhost. Here is the code: gm(200, 200, '#FF0000') .setFormat('png') .fill('#00FF00') .drawCircle( 50, 50, 60, 60 ) .toBuffer(function( error, buffer ) { if( error ) { res.send("error:"+error+" with content length:"+data.ContentLength);} res.writeHead(200, {

Node.js find blob on image using connected components

不羁的心 提交于 2019-12-13 07:04:57
问题 I am trying to x y coordinates of blobs in an image. Following suggestions from this question:Connected-component labeling with ImageMagick I have this piece of code. The end result correctly highlights the blobs. However, I am unable to get the "verbose" output programmatically. I need the x y coordinates. AM I missing something? gm('difference.png') .out('-colorspace') .out('gray') .out('-threshold') .out('90%') .out('-define') .out('connected-components:verbose=true') .out('-connected

How to convert from CGImageRef to GraphicsMagick Blob type?

无人久伴 提交于 2019-12-13 02:14:09
问题 I have a fairly standard RGBA image as a CGImageRef. I'm looking to convert this into a GraphicsMagick Blob (http://www.graphicsmagick.org/Magick++/Image.html#blobs) What's the best way to go about transposing it? I have this but it produces only a plain black image if I specify PNG8 in the pathString or it crashes: - (void)saveImage:(CGImageRef)image path:(NSString *)pathString { CGDataProviderRef dataProvider = CGImageGetDataProvider(image); NSData *data = CFBridgingRelease

How to use graphicsmagick in node.js to crop circle picture (other use any other way to make this on node.js)

旧巷老猫 提交于 2019-12-13 00:38:59
问题 How to use graphicsmagick crop circle picture? (use png transparent background outer circle) I use graphicsmagick in node.js , or have any other way make this in node.js ? Before: http://i.stack.imgur.com/B34C5.png After: http://i.stack.imgur.com/PWjQW.png 回答1: After many hours of fiddling, I found a clean solution using node-gm and Imagemagick. var gm = require('gm').subClass({ imageMagick: true }); var original = 'app-server/photo.jpg'; var output = 'app-server/photo.png'; var size = 80; gm

Why do Imagemagick or GraphicsMagick increase the MB size of my PNG image when resizing to a smaller dimension?

删除回忆录丶 提交于 2019-12-12 19:25:35
问题 I need to convert from png to png. I am using ImageMagick 6.8.7-7 on Mac OS X to decrease the dimension of my png. Here is an exact example : start.png : 20866 × 8957 = 6.6 MB start.png is a detailed floor plan just black and white convert start.png -resize 16384x7033 out.png Result is out.png 16384 × 7033 = 36.9 MB (even convert start.png -resize 16384x7033 out.jpg => out.jpg 22.7MB) If I apply "pngquant" to out.png I can reduce to 15MB Why does this increase happen? I am looking for a

Graphicsmagick gives higher filesize when compressing jpg

喜你入骨 提交于 2019-12-12 05:37:03
问题 First i took lena512color.tiff amd converted it to jpg and then i ran mogrify on it with a quality of 90%.Surprising after i decrease the quality filesize is higher.What am I doing wrong here ? gm convert lena512color.tiff lena512color.jpg # filesize = 37,043 gm mogrify -quality 90 lena512color.jpg # filesize = 58,132 回答1: By default, the output quality is set to whatever GraphicsMagick thinks the quality of the input file is. So I guess it thinks the TIFF's quality is lower than 90 and you

how to control the distorted and stretched image in graphicsmagick node.js

蓝咒 提交于 2019-12-12 03:28:35
问题 I want an image to be display by keeping its aspect ratio same by re-sizing it, but the image looks stretched. I have three images all of 50 by 50. I want the left image to be re-sized by maintaining its aspect ratio. The other two images will be shown up and down parallel to the first image. I think mosaic() build the four blocks. but I want three blocks, in fitst block first image will come up and it would be re-sized all the way till end, and the next two blocks the other two images will

About Graphics Magick for node Error

走远了吗. 提交于 2019-12-11 17:41:15
问题 I run nodejs in windows and install gm with npm. var readStream = fs.createReadStream(__dirname + '/../temp/a.jpg'); gm(readStream, 'a.jpg').write(__dirname + '/../temp/b.png', function (err) {if (err) console.log(err);}); Then I got the msg: { [Error: Command failed: CreateProcessW: ϵͳ�Ҳ���ָ�����ļ���] code: 127, signal: null } Does gm support the windows or how could I deal with? 回答1: Putting the GraphicsMagick installation directory in the PATH environment variable solved the problem for me

Downloading latest version from sourceforge

狂风中的少年 提交于 2019-12-11 07:00:54
问题 I am trying to download latest version of graphicsmagick from Sourceforge in my bash script wget -q https://sourceforge.net/projects/graphicsmagick/files/latest/download?source=files -O GraphicsMagick-LATEST.tar.gz tar -xzvf GraphicsMagick-LATEST.tar.gz The problem is that when I try to extract the tar.gz I get the following error gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now This means that the script is not downloading the latest tar