ImageMagick

ImageMagick split image by background color

孤街醉人 提交于 2019-12-14 03:12:35
问题 I have big image https://buildyourboard.pro/userboards/board-img/data/clipart.png how can I segmentate this image to small images by transparent (or another) background? Images not in grid, so code should find position of every pic in image 回答1: If you run this command, it will scrunch all the pixels up into an image that is just one pixel wide and has the original height of your image. You will then see that all lines that have the word none correspond to all the locations where you can draw

Rails CarrierWave versions are not created for some reason

别说谁变了你拦得住时间么 提交于 2019-12-14 02:15:42
问题 I have the following file uploader class ItemImageUploader < CarrierWave::Uploader::Base include ::CarrierWave::Backgrounder::Delay include CarrierWave::MiniMagick include Sprockets::Helpers::RailsHelper include Sprockets::Helpers::IsolatedHelper def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end # Provide a default URL as a default if there hasn't been a file uploaded: def default_url asset_path("fallback/" + [version_name, "image.png"].compact.join('_'))

How to tile in left-right-bottom-top order in imagemagick montage

為{幸葍}努か 提交于 2019-12-13 19:22:48
问题 I have a several sets of numbered png images (mostly 00-23 but some are different lengths) that I am trying to combine in imagemagick montage, but I need to have them tiled in left-right-bottom-top instead of left-right-top-bottom order. How can I do this? 回答1: You could use the "-scene" command to specify the "tile number". Check out the imagemagick documentation here. 来源: https://stackoverflow.com/questions/3695597/how-to-tile-in-left-right-bottom-top-order-in-imagemagick-montage

ImageMagick result differ from Magick++

萝らか妹 提交于 2019-12-13 18:40:12
问题 I have 3 images: source.jpg, saturated.jpg and mask.jpg , I want to blend the source.jpg and saturated.jpg using the mask.jpg . When I use the ImageMagick's convert command: convert source.jpg saturated.jpg mask.jpg -compose over -composite result.jpg I get this result. But when I do the same with Magick++: Magick::Image source,saturated,mask; source.read("source.jpg"); saturated.read("saturated.jpg"); mask.read("mask.jpg"); source.clipMask(mask); source.composite(saturated,0,0

How to make thumbnails using Imagick::resizeImage appear sharper - PHP?

ぃ、小莉子 提交于 2019-12-13 18:19:05
问题 I am using Imagick::resizeImage to create a thumbnail PNG image of each page of a pdf file. However, the image I am getting back is really blurry. How can I make it a little sharper? Any pointers would be really appreciated. I have tried adjusting the 'blur' paramter of Imagick::resizeImage between 0.1 - 1, without success. $pdfPage = '1Mpublic.pdf[0]'; $im = new imagick($pdfPage); $im->setImageFormat('png'); // Resize thumbnail image $imgHeight = $im -> getImageHeight(); $imgWidth = $im ->

Imagemagick set interline spacing?

…衆ロ難τιáo~ 提交于 2019-12-13 16:56:21
问题 In application using imagemagick the design is specified like this: $draw->setFillColor(new ImagickPixel("#FFFFFF")); $draw->setstrokecolor(new ImagickPixel("#000000")); $draw->setstrokewidth(1); $draw->setFontSize(18); $draw->setfontweight(100); $draw->setFont("fonts/Impact.ttf"); I'd like to set interline Spacing in a similair fashion, but all samples are displayed like this: convert -density 72 -pointsize 12 -interline-spacing 12 -font Arial \ How can I access the interline-spacing command

Shell script to open random jpegs with ImageMagick

[亡魂溺海] 提交于 2019-12-13 16:37:24
问题 I have a large batch of jpegs. I would like to write a shell script that selects 5 images randomly and then, using imageMagick, put them in a montage and then open this montage file. I would like this process to occur every 10 seconds. I have tried this script for f in *.jpg do shuf -ezn 5 * | xards -0 -n1 | montage *.jpg | display montage.jpg done but it is not working It opens all of the images and gives me the following error message image.sh 7: image.sh: Xards: not found the go.sh script

Photoshop script to export layer combinations

别等时光非礼了梦想. 提交于 2019-12-13 16:28:17
问题 I want to make a Photoshop script that lets me export all five layers in a group to a png file - in combination with every single layer from 2 other groups. It's a bit vague so I'll try to illustrate what I want to accomplish. There's the base group (red, blue, yellow, orange, green). Then there is a second group that contains layers 1,2 and 3. Then there's a third group that contains a, b, c and d. I want to be able to export 1_red_a.png, 1_red_b.png, 1_red_c.png, 1_red_d.png, 1_blue_a.png,

Opencv and python for auto cropping

二次信任 提交于 2019-12-13 15:52:38
问题 I want to crop images automatically. I am using ImageMagick for this . Command i am using convert 3.jpg -fuzz 10% -trim trim.jpg How do i fix this . I think there is problem with fuzz factor which am setting . 回答1: If you want to do this with OpenCV, a good starting point may be after doing some simple processing to remove noise and small details in the image, you can find the edges of the image and then find the bounding box and crop to that area. But in case of your second image, you may

PDF: How to Optimize Filesize & Convert to PNG (embedded fonts problem)

别来无恙 提交于 2019-12-13 15:47:23
问题 I have a PDF with embedded fonts that I can't seem to work with. Right now, I'm using GhostScript and trying to do 2 things: Minimize filesize of PDF: gswin32c -dSAFER -dBATCH -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf Convert PDF to PNG (super sample, to be used for creating other thumbnails): gswin32c -dSAFER -dBATCH -dNOPAUSE -dQUIET -dFirstPage=1 -dLastPage=1 -r288 -sDEVICE=png16m -sOutputFile=output.pdf input.pdf The above works well when working on scanned