ImageMagick

Using Magick.NET with C#

蓝咒 提交于 2021-02-07 08:51:42
问题 I am trying to implement a functionality using Magick.NET in C#. Previously I was using:- // Convert to a png. Process p = new Process(); p.StartInfo.FileName = @"C:\Program Files\ImageMagick-6.2.8-Q16\convert.exe"; p.StartInfo.Arguments = "-scale 60% \"" + svg + "\" \"" + png + "\""; p.StartInfo.CreateNoWindow = true; p.Start(); p.WaitForExit(); TransmitFile(context, png); I want to move away from having to store convert.exe on the server.....Now I want to use something that will be in code

Using Magick.NET with C#

狂风中的少年 提交于 2021-02-07 08:51:19
问题 I am trying to implement a functionality using Magick.NET in C#. Previously I was using:- // Convert to a png. Process p = new Process(); p.StartInfo.FileName = @"C:\Program Files\ImageMagick-6.2.8-Q16\convert.exe"; p.StartInfo.Arguments = "-scale 60% \"" + svg + "\" \"" + png + "\""; p.StartInfo.CreateNoWindow = true; p.Start(); p.WaitForExit(); TransmitFile(context, png); I want to move away from having to store convert.exe on the server.....Now I want to use something that will be in code

Fast and efficient way to detect if two images are visually identical in Python

烈酒焚心 提交于 2021-02-07 06:32:22
问题 Given two images: image1.jpg image2.jpg What's a fast way to detect if they are visually identical in Python? For example, they may have different EXIF data which would yield different checksums, even though the image data is the same). Imagemagick has an excellent tool, "identify," that produces a visual hash of an image, but it's very processor intensive. 回答1: Using PIL/Pillow: from PIL import Image im1 = Image.open('image1.jpg') im2 = Image.open('image2.jpg') if list(im1.getdata()) == list

Fast and efficient way to detect if two images are visually identical in Python

僤鯓⒐⒋嵵緔 提交于 2021-02-07 06:32:20
问题 Given two images: image1.jpg image2.jpg What's a fast way to detect if they are visually identical in Python? For example, they may have different EXIF data which would yield different checksums, even though the image data is the same). Imagemagick has an excellent tool, "identify," that produces a visual hash of an image, but it's very processor intensive. 回答1: Using PIL/Pillow: from PIL import Image im1 = Image.open('image1.jpg') im2 = Image.open('image2.jpg') if list(im1.getdata()) == list

gm conversion issue in node.js

北城以北 提交于 2021-02-07 05:36:05
问题 I am converting an image from jpg to png, but it is giving the error. Below is the code and error. gm('E:/image1.jpg').write('E:/image2.png', function(err){ if (err){ console.log(err); } else{console.log('image converted.')} }) The error is: [Error: Could not execute GraphicsMagick/ImageMagick: gm "convert" "E:/image1.jpg" "E:/image2.png" this most likely means the gm/convert binaries can't be found] Do I have to npm graphicsmagick and imagemagick? 回答1: Probably graphicsmagick / imagemagick

Resizing images with Nodejs and Imagemagick

狂风中的少年 提交于 2021-02-06 06:00:49
问题 Using nodejs and imagemagick am able to re-size an image and send it to the browser with this. var http = require('http'), spawn = require('child_process').spawn; http.createServer(function(req, res) { var image = 'test.jpg'; var convert = spawn('convert', [image, '-resize', '100x100', '-']); convert.stdout.pipe(res); convert.stderr.pipe(process.stderr); }).listen(8080); The test image is read from the file-system, I want to alter so that test image is a binary string. var image = 'some long

Resizing images with Nodejs and Imagemagick

痞子三分冷 提交于 2021-02-06 06:00:25
问题 Using nodejs and imagemagick am able to re-size an image and send it to the browser with this. var http = require('http'), spawn = require('child_process').spawn; http.createServer(function(req, res) { var image = 'test.jpg'; var convert = spawn('convert', [image, '-resize', '100x100', '-']); convert.stdout.pipe(res); convert.stderr.pipe(process.stderr); }).listen(8080); The test image is read from the file-system, I want to alter so that test image is a binary string. var image = 'some long

How to perform perspective distort transformation in VIPS?

二次信任 提交于 2021-02-05 08:56:36
问题 Is it possible to do the following ImageMagick perspective distort command using VIPS? If so, what would the command be (using ruby-vips )? $ convert my_file.png -matte -virtual-pixel transparent +distort Perspective '0,0,0,60 1500,0,300,0 0,2100,0,2310 1500,2100,300,2100' -crop 300x2310+0+0 回答1: There isn't a built-in thing for perspective distort, but you can make one using mapim : http://jcupitt.github.io/libvips/API/current/libvips-resample.html#vips-mapim #!/usr/bin/ruby require 'vips'

How to find out which font can display these characters?

拥有回忆 提交于 2021-02-05 08:32:15
问题 ⚫⚪ Unicode U+26AB Unicode U+26AA This two characters can be display in terminal, I want use convert (imagemagick command) to convert those text into picture. But convert only can use one special font , not fallback font could be used. convert -list font So how can I find which font could display those characters? 回答1: I adapted the code in this answer, to make a script to find which font contains a particular character as follows: #!/usr/bin/env python3 import os, sys import unicodedata from

How to find out which font can display these characters?

烈酒焚心 提交于 2021-02-05 08:32:04
问题 ⚫⚪ Unicode U+26AB Unicode U+26AA This two characters can be display in terminal, I want use convert (imagemagick command) to convert those text into picture. But convert only can use one special font , not fallback font could be used. convert -list font So how can I find which font could display those characters? 回答1: I adapted the code in this answer, to make a script to find which font contains a particular character as follows: #!/usr/bin/env python3 import os, sys import unicodedata from