ImageMagick

Resize huge images in Python (bigger than available RAM)

安稳与你 提交于 2020-01-10 20:11:33
问题 I would like to resize and split huge (1 TB) images to 256x256 pixel tiles (Zoomify / OSM / Google Maps / XYZ schema). Images would be in BigTIFF or PSB (Large Document Format or Photoshop Big) format. What are the available libraries which can do this? I was having a look at GDAL but it was producing quite blurry output and I couldn't set it to interpolate better. Ideally I'd be looking at a Lanczos interpolator for such task. Are there any native Python libraries, or wrappers for C based

Resize huge images in Python (bigger than available RAM)

痴心易碎 提交于 2020-01-10 20:11:30
问题 I would like to resize and split huge (1 TB) images to 256x256 pixel tiles (Zoomify / OSM / Google Maps / XYZ schema). Images would be in BigTIFF or PSB (Large Document Format or Photoshop Big) format. What are the available libraries which can do this? I was having a look at GDAL but it was producing quite blurry output and I couldn't set it to interpolate better. Ideally I'd be looking at a Lanczos interpolator for such task. Are there any native Python libraries, or wrappers for C based

Should I use a PHP extension for ImageMagick or just use PHP's Exec() function to run the terminal commands?

依然范特西╮ 提交于 2020-01-10 20:04:21
问题 I need to do the following image manipulations for images uploaded by users on my site: Resize images (if greater than a certain dimension) Convert all image formats to jpg's Add a watermark to the bottom of all images Do I need to use either the MagickWand or iMagick extensions or can I just get away with running the terminal commands inside PHP's exec function? Is there a reason why the PHP extensions would be preferred? Which would be faster and better for performance (this site may have

Should I use a PHP extension for ImageMagick or just use PHP's Exec() function to run the terminal commands?

耗尽温柔 提交于 2020-01-10 20:04:09
问题 I need to do the following image manipulations for images uploaded by users on my site: Resize images (if greater than a certain dimension) Convert all image formats to jpg's Add a watermark to the bottom of all images Do I need to use either the MagickWand or iMagick extensions or can I just get away with running the terminal commands inside PHP's exec function? Is there a reason why the PHP extensions would be preferred? Which would be faster and better for performance (this site may have

Ruby on Rails, Paperclip: “identify” command working in cmd but not in app

血红的双手。 提交于 2020-01-10 20:00:07
问题 I've installed ImageMagick on my Windows 7 64bit and I have the Paperclip Gem. My User model looks like this: class User < ActiveRecord::Base # Paperclip has_attached_file :photo, :styles => { :thumb=> "100x100#", :small => "150x150>" } end In paperclip.rb and development.rb I have: Paperclip.options[:command_path] = 'C:/Program Files/ImageMagick-6.6.7-Q16' My _form looks like this: <%= form_for(@user, :html => { :multipart => true } ) do |f| %> <% if @user.errors.any? %> <div id="error

Conversion PDF to PNG or JPEG is very very slow using ImageMagick

谁说我不能喝 提交于 2020-01-10 16:36:42
问题 I have a working PDF to PNG conversion script using PHP and ImageMagick but I am having a problem with the speed of the conversion. I know it works because with a very small PDF the time taken to convert is not that great, but with a 250kb file (still not that large really) it takes in excess of 20 minutes to convert. Here's the PHP: //***** GET PATH TO IMAGEMAGICK ***** $path_to_imagemagick = trim(`which convert`); //***** PATH TO PDF TO CONVERT ***** $path_to_pdf = getcwd() . "/pdf/myfile

Conversion PDF to PNG or JPEG is very very slow using ImageMagick

自闭症网瘾萝莉.ら 提交于 2020-01-10 16:34:10
问题 I have a working PDF to PNG conversion script using PHP and ImageMagick but I am having a problem with the speed of the conversion. I know it works because with a very small PDF the time taken to convert is not that great, but with a 250kb file (still not that large really) it takes in excess of 20 minutes to convert. Here's the PHP: //***** GET PATH TO IMAGEMAGICK ***** $path_to_imagemagick = trim(`which convert`); //***** PATH TO PDF TO CONVERT ***** $path_to_pdf = getcwd() . "/pdf/myfile

使用gm和imageMagick处理图片

谁都会走 提交于 2020-01-10 09:08:14
第一步安装imageMagick和gm模块 1, cnpm install --save imageMagick gm 第二步在服务器上安装imageMagick,下载地址http://www.imagemagick.org/download/windows/ ( 另外安装时需要勾选Install legacy utilities(e.g. convert)选项 ) 第三步 代码使用 var imageMagick = gm.subClass({ imageMagick : true }); var fs= require('fs'); var formidable = require('formidable'); router.post('/upload',function(req,res){ var host = req.headers.host; var origin = req.protocol + "://" + host; var form = new formidable.IncomingForm(); form.uploadDir = "tmp"; //指定文件存放的临时目录 form.parse(req, function(err, fields, files) { if(files.wangEditorH5File){//h5方式上传 var

[bat] 图片裁剪工具ImageMagick

帅比萌擦擦* 提交于 2020-01-10 03:57:05
http://www.imagemagick.org/Usage/resize/#fill @ECHO OFF REM ===========变量定义============ REM 裁减后尺寸请配置到output.config,用空格分割 文件名 长 宽 REM 源文件,不带后缀(默认后缀都是.jpg) SET IMAGE_FILE=Penguins REM 裁减重心 SET GRAVITY=center REM convert.exe的路径 SET CONVERT_PATH=convert.exe REM option1:保持原图比例剪裁 ; option2:不保持原图比例压缩 REM 示例:::option1:保持原图比例剪裁 REM .\ImageMagick6.7.9\convert Penguins.jpg -gravity center -resize 300x -resize x100^< -crop 300x100+0+0 +repage test_300x100.jpg REM ::option2:不保持原图比例压缩 REM convert Penguins.jpg -resize 500x120! test_500x120.jpg SET OPTHON=OPTION2 REM ===========执行代码============ if "%OPTHON%"=

How to install, test, convert, resize PDF using ImageMagick, Ghostscript, Windows Vista/7 x64

北战南征 提交于 2020-01-09 09:54:09
问题 I'm having trouble with getting ImageMagick and Ghostscript to work together - everything seems difficult, from installation, to testing, to actually using the software. Does anyone have any tips? 回答1: I've just spent the last three hours getting ImageMagick to play nicely with PHP for a PDF to JPG convert. Instead of documenting it myself locally, I figured I'd write it up here, with all the buzzwords and things I screwed up, so the next noob can save some time. Tested on two OSs,Windows 7