graphicsmagick

graphicsmagick - tips for optimizing montage and composite?

穿精又带淫゛_ 提交于 2019-12-25 07:39:52
问题 for a little photo booth application have this problem: I have 4 pictures, which i would like to tile together, using montage . The result get a 150px border using a transparent PNG and composite . But because the "frame" is larger than the base image, I have to add an additional convert to add artificial 150px border around the tiled image. This is functional but very slow and seems not very elegant: gm montage -geometry +20+20 -tile 2x2 /home/pi/dev/*.jpg miff:- | gm convert -border 150x150

GraphicsMagick replace all colors (except yellow) to transparent

拈花ヽ惹草 提交于 2019-12-25 06:58:55
问题 Tried to replace all colors except yellow (with some -fuzz) to transparent without result. Didn't find anything in documentation maybe someone can help me. Thank you. As I know in ImageMagic there is +opaque, but I can't use this library 回答1: This should do what you want. It makes the yellow pixels transparent and then inverts the alpha channel. gm convert input.png +matte -matte -fuzz 5% -transparent yellow -operator matte negate 1 output.png The "+matte" removes any existing transparency

GraphicsMagick replace all colors (except yellow) to transparent

随声附和 提交于 2019-12-25 06:57:16
问题 Tried to replace all colors except yellow (with some -fuzz) to transparent without result. Didn't find anything in documentation maybe someone can help me. Thank you. As I know in ImageMagic there is +opaque, but I can't use this library 回答1: This should do what you want. It makes the yellow pixels transparent and then inverts the alpha channel. gm convert input.png +matte -matte -fuzz 5% -transparent yellow -operator matte negate 1 output.png The "+matte" removes any existing transparency

Express GraphicsMagick

牧云@^-^@ 提交于 2019-12-25 02:22:11
问题 I'm currently building a MEAN app and the section I'm currently working on involves image uploads. I'm trying to use GraphicsMagick for Node but I'm not really having any success. Below is my POST request for image uploads (as is): app.post('/api/users/upload_image', function (req, res) { var fstream; req.pipe(req.busboy); req.busboy.on('file', function (fieldname, file, filename) { console.log('\n\nUploading file: '.underline.bold +filename .underline.bold); // var readStream = fs

pgmagick image object to blob

狂风中的少年 提交于 2019-12-24 21:37:48
问题 Is there a way I can convert the Image() object to blob? If I want to serve an image which is created by pgmagick to a HTTP request without writing it on the disk, I see converting the image object to blob and then streaming back to the request is the only option. Let me know if there are any alternatives to achieve this. Below is the code sample which creates an image. from flask import Flask from pgmagick import Image, Geometry, Color, \ DrawableText app = Flask(__name__) @app.route("/")

graphicsmagick is doubling the size of “some” PNG files

不问归期 提交于 2019-12-24 07:05:19
问题 Using GraphicsMagick to read in a PNG file and write it out under a different name is causing the file size to increase by more than double. This only happens to some PNG files and I can't figure out what is causing it. Example problem PNG: http://www.google.co.in/logos/2011/verne-hp-3.png I have tried everything from disabling the opacity channel to using different compression types to changing the interlacing type but nothing is helping me understand what is causing this problem. If anyone

How to fix .gif with corrupted alpha channel (stuck pixels) collected with Graphicsmagick?

孤街醉人 提交于 2019-12-24 01:57:15
问题 I want to convert an .avi with alpha channel into a .gif. Firstly, I use ffmpeg -i source.avi -vf scale=720:-1:flags=lanczos,fps=10 frames/ffout%03d.png to convert .avi to sequence of .png's with aplha channel. Then, I use gm convert -loop 0 frames/ffout*.png output.gif to collect a .gif. But it seems that pixels of the output.gif just get stuck when something opaque is rendered on top of the transparent areas. Here's an example: As you can see the hearts and explosions do not get derendered.

Combine two gm objects while resizing one of them in graphicsMagick for NodeJS

谁都会走 提交于 2019-12-24 00:11:47
问题 var image = gm(someImageUrl) .resize(100,100); var drawings = gm(200,200,'red') .fill('blue') .drawRectangle(20,20,40,40); // Would be great to have sth like this. drawings.drawImage(image, position) // or drawings.add(image, position) // or drawings.draw(image, position) Append is not an option as I would like them to overlap and set precise position to the image 回答1: This is possible by resorting to composition options (i.e. the command() and in() functions on the object that gm() returns),

How do I configure a JPEG delegate for graphicsmagick?

青春壹個敷衍的年華 提交于 2019-12-23 19:09:05
问题 I want to crop an image to a specified pixel region. I'd like to use the gm module from https://github.com/aheckmann/gm. I am running Linux Mint 13 and node.js v0.9.4pre. I am running into an error that sounds like graphicsmagick doesn't know about jpegs: Error: Command failed: gm convert: No decode delegate for this image format (./assets/images/temp/2aadd4379e1cf2b59429994270db2a8a.jpg) Sure enough, gm convert -list formats shows no jpeg delegate: <snip> IPTC P rw- IPTC Newsphoto IPTCTEXT P

GraphicsMagick for node not masking

天涯浪子 提交于 2019-12-23 06:02:29
问题 I'm using GraphicsMagick for node to take a source image, resize, crop and then apply a mask: gm(tempfile) .quality(90) .resize(null, 38) .gravity('Center') .crop(20, 34) .mask('./public/assets/mask.png') .write(thumb, function (err) { if (err) throw err console.log('success') }) After running, The image is resized and cropped successfully, but the mask is not applied. No error is thrown (i.e. the console prints 'success'). Attached to this is also the mask image I'm trying to use. I want the