crop

Java image library to deskew and crop images

Does anybody have a suggestion for a java library that performs automatic cropping and deskewing of images (like those retrieved from a flatbed scanner)? ...

JQuery Crop Image

Hello, I'm trying to figure out how to fixed the selection box size under JCrop, he mentions how to set an initial selection area but not how to make it fixed size. Does anybody knows how could I make it fixed. Thanks in advance. http://deepliquid.com/content/Jcrop_Manual.html ...

JavaScript drag and drop photo resizer cropper

I have an image of arbitrary size on the page. As an output I need an image of a fixed size, say 90x120px. I would like the user to chose the area of the image by drag-and-dropping the big image behind the 90x120px 'window'. The window would specify the resulting image. Something like this is implemented at facebook image upload. I know...

Python, PIL, crop problem

Can't seem to get crop working correctly, problem is, it crops a region of correct dimensions, but always from top left corner (0, 0), instead of from my passed coordinates. image = Image.open(input) region = image.crop((1000,400,2000,600) region.save(output) In image.py from PIL, method _ImageCrop I've printed out.. : print x0, y0, ...

What's a more elegant rephrasing of this cropping algorithm? (in Python)

I want to crop a thumbnail image in my Django application, so that I get a quadratic image that shows the center of the image. This is not very hard, I agree. I have already written some code that does exactly this, but somehow it lacks a certain ... elegance. I don't want to play code golf, but there must be a way to express this shor...

Resize a picture to a fixed size

Hello , I need to resize a picture to a fixed size. But it has to keep the factors between the width and height. Say I want to resize a picture from 238 (w) X 182 (h) to 210 / 150 What I do now is: Original width / target width = 1.333333 Original Height / target Height = 1.213333 Now I take the smallest factor. Now I always hav...

Python's PIL crop problem: color of cropped image screwed

Hi, I have a probably very basic problem with PIL's crop function: The cropped image's colors are totally screwed. Here's the code: >>> from PIL import Image >>> img = Image.open('football.jpg') >>> img <PIL.JpegImagePlugin.JpegImageFile instance at 0x00 >>> img.format 'JPEG' >>> img.mode 'RGB' >>> box = (120,190,400,415) >>> area = img...

How can I crop image without changing its resolution in C#.Net ?

Hi, I made small program to divide large pictures and take part of them. When i import image that made by "Microsoft Paint" this image is "96 dpi" so my program doing well. But I've pictures that made by Photoshop its resolution is 71.6 dpi when i crop these pictures the new cropped picture take 96 dpi resolution so the size is deferen...

How to crop part of gif image?

Hi every one, i wrote some code to crop large image to small one. Everything is OK but when i tried GIF images i get the following exception "A Graphics object cannot be created from an image that has an indexed pixel format." I'm using Graphics class to do this Graphics gfx = Graphics.FromImage(croppedBitmap) thank you. ...

Existing implementation of cropImage:to:andScaleTo: and straightenAndScaleImage()?

I'm writing code to use UIImagePickerController. Corey previously posted some nice sample code on SO related to cropping and scaling. However, it doesn't have implementations of cropImage:to:andScaleTo: nor straightenAndScaleImage(). Here's how they're used: newImage = [self cropImage:originalImage to:croppingRect andScaleTo:scaledIma...

How can I crop/scale user images so I can display fixed sized thumbnails without skewing and stretching?

I'm working on allowing users to upload profile pictures for my site. The classic example of what I'm trying to avoid is plentyoffish.com where each users image is skewed and looks very ugly: So, how can I progmatically crop/create standard sized versions of an image without the skewing demonstrated above? ...

how to change the UIImagePickerController crop frame

when opening working with an UIImagePickerController and setting allowsImageEditing = YES; there is a default cropping frame that is 320x320. In my case, I would like to setup that cropping frame to 320x240 for images that are landscape, and 240x320 for images that are portrait. However, I haven't been able to find a way to change that ...

Simple cropping with Paperclip

I would like to crop images on upload using Paperclip to get square thumbs from the center of the original picture. I find out a method in documentation that seems to do exactly what I want: transformation_to(dst, crop = false) The problem is that I can't figure out where to use this method. It would be great to simply pass something a...

How to crop huge image

I need to process large images (20,000x20,000pixels) in C#. Opening these images directly isn't the way to go because of memory limitations, but what I want to do is split the image into smaller pieces (cropping). I was looking for a 3rd party library that could the trick, but so far no result. I tried FreeImage and ImageMagick, but they...

Whats the algorithm to calculate aspect ratio? I need an output like: 4:3, 16:9

I plan to use it with javascript to crop an image to fit the entire window. I appreciate all help you can provide. Edit: I'll be using a 3rd part component that only accepts the aspect ratio in the format like: 4:3, 16:9 ...

WPF- How Can I Show a Cropped Region of an ImageSource in an <Image> Control?

WPF- How can I show a cropped region of an ImageSource in an control? I have an ImageSource of a vairable size in pixels. I have a caculated crop rectangle, indicating how much of the image we are actually going to use. I don't want to edit the image data directly, but I want my <Image> control to display only the cropped region of t...

Why do I need to specify a resolution for cropping?

I wrote a method to crop images in C#. It does it by creating a new Bitmap and drawing onto it a specified rectangle (the area to be cropped) from the original image. For the images I've tried with it was generating wrong results. The size of the resulting image was right, but the content was it. It was like if the image has been scaled...

Using attachment_fu, how do you edit an existing photo, update only thumbnails, and leave original unedited?

After a photo is uploaded and created using attachment_fu, is there a way to edit just the thumbnails and leave the original as it is? I understand how to do the resizing or cropping, but it's applying the edits to all of the thumbnails and the originals, which is how I'm sure attachment_fu was intended to work. For example, say in a p...

PHP GD - Crop Shape

I want to crop images using the GD, but I want it to crop around a particular shape rather than just a square. Is this possible? ...

script for cropping images

Hi! I have many (about 1000) images (printscreens), and I need to crop these images (all cropped images are in the same region in the full image). How can I do this in php? Or maybe GIMP is supporting some macro scripts to do this? Thanks in advance. ...