imaging

In matlab, how do you save a figure as an image in the same way as using "Save As..." in the figure window??

Hey guys, Do you know what function the actual figure window uses when you go File>Save As... and then select .png or another image format?? Because I am trying to automate saving, but when I use saveas or print, the resulting image is really pixelated, but if I look at the actual figure, and use the File>Save As... method as above, and...

open multi image pages to different Bitmap objects in .net

I am developing an image editor and the structure needs a different Bitmap object for each page. But in .net i couldnt find a fine way. When i use Bitmap.Clone() it gives the same bitmap (not only one page) The code below works fine but its dirty and slow. So what would be the best way of opening a multi-image to separate Bitmap objec...

What's the simplest way in Python to resize an image to a given bounded area?

I'd like to create a function, like: def generateThumbnail(self, width, height): """ Generates thumbnails for an image """ im = Image.open(self._file) im.thumbnail((width, height), Image.ANTIALIAS) im.save(self._path + str(width) + 'x' + str(height) + '-' + self._filename, "JPEG") Where a fi...

How to draw centered text onto a jpg using system.drawing in c#

I am using the following code to draw text onto a jpg image but it requires x/y coordinate percision on where to place the text. var bmp = new Bitmap("C:\\testing\\Given.jpg"); var gra = Graphics.FromImage(bmp); var text = "The Berman's"; var font = new Font("Segoe Script", 24); var brush = Brushes.Orange; var point = new PointF(130, 2...

How to do color balancing using a gray card in C#

I need to color balance an image that has an 18% gray card in it. The user loads this image into the application, then clicks on the gray card. From here is where I need help with an algorithm to color balance the image. I've found a few articles that mention doing a matrix transform, which I've tried, but without success (the image w...

Is it possible to modify a WPF BitmapSource in memory 'unsafe'ly from another thread

I would like to do some processing of images in a WPF application. However, I would like to modify the pixels of a BitmapSource in memory at runtime. I'm currently managing to do this using 'unsafe' code against an old fashioned System.Drawing.Bitmap and it works a treat (lock a working area, fiddle with the pixels) job done. The approa...

[Windows Imaging] Prevent GDI+ PNG Encoder from adding Gamma information to a 1-bit PNG

I wonder if its possible to instruct the Imaging PNG Encoder not to add any gamma and chroma informations to a 1-bit PNG. I am creating a 2 color palette for the image ColorPalette* pal = (ColorPalette*)CoTaskMemAlloc(sizeof(ColorPalette) + 2 * sizeof(ARGB)); pal->Count = 2; pal->Flags = 0; pal->Entries[0] = MAKEARGB(0,0,0...

WIA 2.0 Duplex property

Hello, I am developing an aplication with C# to use the WIA 2.0 library. At the moment I could use most of the features, such as ADF (auto document feeder), filters and more. Now, I need to use the duplexer of my scanner (fujitsu). I'm trying to set the WIA_DPS_DOCUMENT_HANDLING_SELECT scanner property to the DUPLEX value. See the cod...