ImageMagick

Taking a Screen Shot of an Embedded Linux Framebuffer

假如想象 提交于 2020-01-01 11:50:36
问题 I'm running Embedded Linux on an evaluation kit (Zoom OMAP35x Torpedo Development Kit). The board has an LCD and I would like to be able to take screen shots convert them into a gif or png. I can get the raw data by doing the following: "cp /dev/fb0 screen.raw", but I am stumped on how to convert the image into a gif or png format. I played around with convert from ImageMagick (example: "convert -depth 8 -size 240x320 rgb:./screen.raw -swap 0,2 -separate -combine screen.png"), but have been

Imagemagick animated gif size optimization

守給你的承諾、 提交于 2020-01-01 09:16:36
问题 I am use this code to resize and save a animated gif (php): system("convert *originalfile* -resize *size* -coalesce *newfile*); Once done the filesize is quite large. Usually larger than the original even! What can I do to reduce the file size? I used convert $completeMiff -dither none -matte -depth 8 -deconstruct -layers optimizePlus -colors 32 $optimizedFile_16 and the file gets even bigger??? 回答1: Add -layers optimize system("convert *originalfile* -resize *size* -coalesce -layers optimize

Can paperclip read photo geometry off an S3 bucket?

寵の児 提交于 2020-01-01 08:21:33
问题 I would like to read the geometry of a photo off of my S3 container. When it's on my local, this works : def photo_geometry(style = :original) @geometry ||= {} @geometry[style] ||= Paperclip::Geometry.from_file photo.path(style) end But it doesn't seem to work when I switch my model over to S3.. Any recommendations? The bigger story, is I'm trying to write some code that will allow me to retrieve photos from S3, allow users to crop them, and then reupload them back to S3 still assigned by

Convert JPG image from grayscale to RGB using imagemagick

扶醉桌前 提交于 2020-01-01 08:05:23
问题 I am trying to convert gray scale images to RGB using the imagemagick command-line tools. It is working fine for PNG images, using: convert image.png -define png:color-type=2 result.png (taken from an answer to "How to convert gray scale png image to RGB from comand line using image magick") Although checking with identify -format %r result.png will still return DirectClass Gray , I can see it worked using gdalinfo as there are now 3 bands / channels listed: gdalinfo [successfully converted

Search for similar images with different filenames in two directories

假装没事ソ 提交于 2020-01-01 07:28:09
问题 I have 2 directories with lots and lots of images, say: color/ and gray/ . In color/ images are named: image1.png image2.png, etc. I know that gray/ contains the same images, but in gray-scale, and the file names and order of files is different (eg: file_01.png, but this IS NOT the same image as image1.png). Is it possible to make a comparison of images in both directories and copy color/ files to a results / directory with gray/ file names? Example: directory | directory | directory "color/"

AWS Lambda function - convert PDF to Image

喜欢而已 提交于 2020-01-01 06:31:27
问题 I am developing application where user can upload some drawings in pdf format. Uploaded files are stored on S3. After uploading, files has to be converted to images. For this purpose I have created lambda function which downloads file from S3 to /tmp folder in lambda execution environment and then I call ‘convert’ command from imagemagick. convert sourceFile.pdf targetFile.png Lambda runtime environment is nodejs 4.3. Memory is set to 128MB, timeout 30 sec. Now the problem is that some files

Wrong Image orientation when uploading - Amazon S3

一个人想着一个人 提交于 2020-01-01 04:36:06
问题 I'm letting users upload multiple images directly to Amazon-S3 using Multer-S3 and then displaying those images on the front end via a loop. All works perfectly. However when the images are uploaded via mobile (image taken on an iPhone or Android) the orientation is correct on mobile but does NOT have correct orientation on desktops. Major problem. This is due to the images EXIF data I believe. Seems like ImageMagick or Kraken JS https://kraken.io/docs/storage-s3 might be a way to solve it

How to convert this command to a python code using Wand & ImageMagick

徘徊边缘 提交于 2020-01-01 03:49:06
问题 I want to convert an image so I can read it better using pyocr & tesseract. The Command line I want to convert to python is : convert pic.png -background white -flatten -resize 300% pic_2.png Using python Wand I managed to resize it but I don't know how to do the flattend and the white background My try : from wand.image import Image with Image(filename='pic.png') as image: image.resize(270, 33) #Can I use 300% directly ? image.save(filename='pic2.png') Please help Edit, Here is the image to

Is there any way to convert pdf file to jpg without imagemagick or ghostscript.?

末鹿安然 提交于 2020-01-01 03:45:11
问题 I want to convert pdf files to jpg without use of imagemagick and ghostscript, if anyone have an idea please help me. 回答1: Try using an online conversion service instead. For example transloadit provides an API which can be used to extract images from PDF files (https://transloadit.com/docs/extracting-images-of-documents). They even provide ready development kits for PHP (https://transloadit.com/docs/development-kits#php-sdk). Cloudinary could be an alternative as well. If you instead what to

Defining the file order for ImageMagick convert

£可爱£侵袭症+ 提交于 2020-01-01 02:36:08
问题 I have a bunch of PNG files named foo<bar>.png I wish to convert to TIF animation. <bar> is a number varies from 0 to 25 in leaps of five. ImageMagick place foo5.png last in the animation while it is supposed to be second. Is there a way, apart from renaming the file to foo05.png to place it in the right place? 回答1: You just give the order of your PNG files as they should appear in the animation. Use: foo0.png foo5.png foo10.png foo15.png foo20.png foo25.png instead of foo*.png After all, it