ImageMagick

How to split an image with a grid and preserve transparency bounding box

坚强是说给别人听的谎言 提交于 2019-12-25 03:13:51
问题 I have some png images that I want to split it into parts, like by grid or size. But each part should have the same bounding box (transparency) as original image. Example: Splitting image into 2 parts. Original: 200 × 89 Output: part_1.png, 200 × 89 part_2.png, 200 × 89 Can ImageMagick do this? Or any other app or method. My actual goal is to split into 100+ slices images. EDIT: Another goal to have an indents for each slice. Say indent = 10px . Example: Input: 200 x 100 Output: part_1.png,

Extract small portion of image without loading all of it [closed]

为君一笑 提交于 2019-12-25 02:55:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have large JPG images ( say 20000x10000 pixels) and want to extract sub-images from these images without loading whole image. I found it's possible by using this ImageMagick command: convert -extract 226x248+4216+3377 a.jpg o.jpg But I need to have it in my C# WPF app. Magick.NET did not implement extract

How do I find the largest nearly white rectangle in a bitmap with ImageMagick?

点点圈 提交于 2019-12-25 02:46:55
问题 I'd like to automatically clean up visible borders/shadows in scanned pages. My idea for doing this is simple: detect a largest rectangle in the image in which all pixels are white or nearly white, then crop the image to that rectangle or floodfill the exterior with white. I can write my own program for finding such a rectangle, but I'd prefer to use ImageMagick (which can also do the cropping or floodfilling), netpbm, or other utilities readily available for Linux and Cygwin. Can they do

Imagemagick not creating correct color

女生的网名这么多〃 提交于 2019-12-25 02:25:37
问题 So I when I rung this command: convert -size 32x32 xc:transparent -fill "#ff0000" \ -draw "circle 15,16 8,10" png32:"/Users/rzec/test test.png" a round circle is created however the color is not FF0000 but it is #FC0F1D . Is there any reason this would happen? Interestingly, if I use FFFFFF that is the color that is generated. I am running Mac OS X 10.9 and ImageMagick 6.8.7-7 Q16 x86_64 2013-11-27 来源: https://stackoverflow.com/questions/24862041/imagemagick-not-creating-correct-color

Projecting random images/montages

ⅰ亾dé卋堺 提交于 2019-12-25 00:57:34
问题 I am working on an installation that projects selected random images from a large folder (over 50,000 jpeg of different sizes). I have already posted and received help about this here: Shell script to open random jpegs with ImageMagick #!/bin/bash # Get list of files into array - just once at start files=(*.jpg) # Do forever first=0 while :; do # Shuffle array files=( $(shuf -e "${files[@]}") ) # Make montage of first 5 images in shuffled array montage -background '#000000' ${files[0]} $

Imagemagick no such file or directory error in Mac

。_饼干妹妹 提交于 2019-12-25 00:40:18
问题 I'm using carrierwave to upload images from my rails app, and later pass that image to resque for resizing them in the background. The image gets uploaded properly. The problem when resque tries to resize it, mini_magick says that "No such file or directory" This is my ImageController code which handles the upload #create image and embed into story def create img_attr = params[:image] img_attr[:media] = params[:image][:media].first if params[:image][:media].class == Array image = Image.new

Where is the time going with my ImageMagick rotations?

被刻印的时光 ゝ 提交于 2019-12-25 00:37:48
问题 I need to rotate an image from my Ruby/Rails application and I've been using ImageMagick through the RMagick gem. I've tried both the command line tool (i.e. convert ) and the API (e.g. Magick::Image#rotate ) and in both cases the performance is more than 50 times worse than the corresponding Java operation in java.awt.geom.AffineTransform , per https://code.google.com/p/zxing/issues/detail?id=1745#c21 and the corresponding response (i.e. more than a second vs. 10s of milliseconds). I've

Adding current date to a signature image and adding it into an existing pdf

本秂侑毒 提交于 2019-12-25 00:33:54
问题 I have a signature image and want to add first the current date before it (on the left side) and then add this signature with date together to an existing pdf. The existing pdf is an application form with an area for the signature and date. What I have done so far is: magick \( -size 450x -gravity west -font NimbusSans-Regular label:23.10.2019 \) signature.png +append -strip -quality 100 signaturewithdate.png ^This adds the current date before the signature, works. Afterwards I convert the

Paperclip on Windows - undefined method `split' for nil:NilClass

不打扰是莪最后的温柔 提交于 2019-12-24 23:26:34
问题 I am getting undefined method `split' for nil:NilClass when I am trying to save uploaded file @user.avatar=params[:user][:avatar] Here is the error from server log: [32mCommand[0m :: identify -format %wx%h "C:/progs/web/ror_site_1/tmp/Rus220120701-4976-1sky1nn.jpg[0]" [32mCommand[0m :: identify -format %m "C:/progs/web/ror_site_1/tmp/Rus220120701-4976-1sky1nn.jpg[0]" [32mCommand[0m :: identify -format %m "C:/progs/web/ror_site_1/tmp/Rus220120701-4976-1sky1nn.jpg[0]" [32mCommand[0m :: convert

ImageMagick remove background noise

坚强是说给别人听的谎言 提交于 2019-12-24 23:12:29
问题 In order to be better prepared for the OCR process, I want to remove the background noise on my images(typically this is a scanned image). This is the example: Is there with magick.exe command any approaches how to remove the noise from the images like this? If so, could you please show an example. UPDATED I use ImageMagick-7.0.7-Q16 on Windows 10 回答1: Use -connected-components in ImageMagick to reduce the noise. (Unix syntax) convert \ 3foBc.png -threshold 60% \ -define connected-components