image-processing

Resize Image to fit in bounding box

An easy problem, but for some reason I just can't figure this out today. I need to resize an image to the maximum possible size that will fit in a bounding box while maintaining the aspect ratio. Basicly I'm looking for the code to fill in this function: void CalcNewDimensions(ref int w, ref int h, int MaxWidth, int MaxHeight); Wher...

Looking for Image Slideshow with Preview Images

Checking to see if something like this is available for free or purchase. We would like to be able to set the size of the main image that, when clicked, would open up another window with the high res image in it. The other images in the slideshow would appear below the main image in small thumbnails. Each image could have a descripti...

PHP image GD library not outputting visuals until loop is complete

I am trying to have this function output data and the rescaled image after every loop but it doesn't display anything until it is finished looping through the complete array. I am assuming that this has something to do with the PHP image functions but is there a workaround? function resize_images($images_l){ echo "Resizing Images<br>";...

How would I tint an image programatically on the iPhone?

I would like to tint an image with a color reference. The results should look like the Multiply blending mode in Photoshop, where whites would be replaced with tint: I will be changing the color value continuously. Follow up: I would put the code to do this in my ImageView's drawRect: method, right? As always, a code snippet would g...

How to remove profiles with MagickNet

I am new to ImageMagick and I am using MagickNet. With ImageMagick, I could use option -strip or -profile '*' with convert command to remove profiles. And in MagickNet, I found some properties and functions releated to profiles, such as EXIFProfile, set_Profile. To remove profiles, I used them like this: // to remove profiles fro...

How to use texture compression in openGL?

I'm making an image viewer using openGL and I've run into a situation where I need to load very large (>50MB) images to be viewed. I'm loading the images as textures and displaying them to a GL_QUAD which has been working great for smaller images, but on the large images the loading fails and I get a blank rectangle. So far I've implem...

Revealing an image bit by bit?

I'm trying to get it so, every time someone donates a set amount on a page, another equal portion of an image is revealed. I've got most of the other logic down (PayPal provides nice unique "you've donated" identifiers and such), however, I'm having trouble with revealing the image bit by bit. I tried breaking up the image into small c...

Can I dynamically generate a 300 dpi image from a flash file?

I'm using a compination of actionscript's getPixel and php's imagecreatetruecolor and imagesetpixel to generate a png image of an swf movie inside a browser. At the moment it will output a 72 dpi image at the same resolution as the swf movie, but I've been asked about the possibility of generating a 300 dpi image instead. Is this possi...

How to implement a box or gaussian blur on iPhone

I want to be able to take an image and blur it relatively quickly (say in 0.1 sec). Image size would almost never be larger than 256 x 256 px. Do I have to loop thru every pixel and average them with neighbors or is there a higher-level way that I could do this? PS: I am aware that multiple box blurs can approximate a gaussian blur. ...

Algorithm to detect photo orientation

I would like to rotate photos automatically, even when EXIF metadata about the image orientation is not available. Are there any good algorithms for detecting the orientation of a photo? The images are photographs from a digital camera. The algorithm doesn't have to work perfectly, but any reduction in the amount of human interaction r...

How does Google do Maps' Street View Cursor "Following"

In Google Maps Street View your cursor turns into a rectangular/oval shape as you mouse over different parts of the scene. For example: http://maps.google.com/?q=loc:+Maryland+Ave+at+e.+26th+st+Baltimore+MD+US&amp;ie=UTF8&amp;z=16&amp;iwloc=A&amp;layer=c&amp;cbll=39.319313,-76.618426&amp;panoid=6W2XgkHoGuf6_SKv0LIL9Q&amp;cbp=12,307.06,,...

Corner detection algorithm for mobile

Hi, I am trying to find a good algorihtm that would detect corners in a image in a mobile phone. There are multiple algorithms to do that I am not sure which one will perform better in a memory and processor limited environment. Specifically I am trying to find a sudoku grid in a picture taken using the camera of the phone. I am using...

How to use the VGA camera as a optical sensor?

Hi, I am designing an information kiosk which incorporates a mobile phone hidden inside the kiosk. I wonder whether it would be possible to use the VGA camera of the phone as a sensor to detect when somebody is standing in front of the kiosk. Which SW components (e.g. Java, APIs, bluetooth stack etc) would be required for a code to use...

Changing palette's of 8-bit .png images using python PIL

I'm looking for a fast way to apply a new palette to an existing 8-bit .png image. How can I do that? Is the .png re-encoded when I save the image? (Own answer: it seems so) What I have tried (edited): import Image, ImagePalette output = StringIO.StringIO() palette = (.....) #long palette of 768 items im = Image.open('test_palette.png'...

Find bounding rectangle of objects in monochrome bitmaps

Given a monochrome bitmap: 000000000000000000000000000000000000000 001000100000000000000000000000000000000 000101000000000000000000000000000000000 000010000000001000000000000000000000000 000101000000010100000000000000000000000 001000100000100010000000000000000000000 000000000000010100000000000000000000000 000000000000001000000000000000...

Trying to understand Django's sorl-thumbnail

I have been playing around with sorl-thumbnail for Django. And trying to understand how it works better. I've read the guide for it, installed it in my site-packages, made sure PIL is installed correctly, put 'sorl.thumbnail' in the INSTALLED APPS in my settings.py, put 'from sorl.thumbnail.fields import ImageWithThumbnailsField' at th...

Need C# function to convert grayscale TIFF to black & white (monochrome/1BPP) TIFF

I need a C# function that will take a Byte[] of an 8 bit grayscale TIFF, and return a Byte[] of a 1 bit (black & white) TIFF. I'm fairly new to working with TIFFs, but the general idea is that we need to convert them from grayscale or color to black and white/monochrome/binary image format. We receive the images via a WCF as a Byte[], ...

White balance algorithm

I'm doing some image processing and I need an automatic white balancing algorithm thats not too cpu intensive. Any recommendations? edit: and if it's relevant to efficiency, I'll be implementing it in java with color images as an array of integers. ...

Finding specific pixel colors of a BitmapImage

I have a WPF BitmapImage which I loaded from a .JPG file, as follows: this.m_image1.Source = new BitmapImage(new Uri(path)); I want to query as to what the colour is at specific points. For example, what is the RGB value at pixel (65,32)? How do I go about this? I was taking this approach: ImageSource ims = m_image1.Source; ...

Similarity Between Colors

I'm writing a program that works with images and at some point I need to posterize the image. This means I need to bin the colors, but I'm having trouble deciding how to tell how close one color is to another. Given a color in RGB, I can think of at least 2 ways to see how different they are: |r1 - r2| + |g1 - g2| + |b1 - b2| sqrt((r1...