Hi all

I am currently working on a project that involves Gdi+ and resizing jpeg images.

I am not satisfied with the picture quality I get.
Is there something in Gdi+ that I have missed?
Which interpolation method gives, in your opinion the best result?

Posted on 2005-08-28 15:33:04 by KetilO
HiQualityBicubic IMO on my PC

OS: Win2K SP4
VC: Radeon 9550 (w/ 9600 BIOS)
Posted on 2005-08-28 21:59:28 by x86asm
Hi Ketil,

Can you post the gdiplus.inc and gdiplus_structs.inc files, I don't have them and would like to tweak around with your application to do some tests I had in mind.

Posted on 2005-08-30 21:10:20 by donkey
Hi Edgar

Shure, you can find it here:


Link updated.
Posted on 2005-08-31 03:33:40 by KetilO
Hi KetilO
The link to the GDI+ inc file seems to be broken. Can you check it please. Thanks


Posted on 2006-04-26 11:02:21 by Biterider
Do like I do, I don't use gdi to resize the images
if you have a handle to a image you can get the dibits
and right in ram resize them without lose of color
and set them back to a handle.

Infact I have wrote such proc's to resize inlarge image, shrink image
flip image, rotate image, brighten image, dim image, grayscale image

all done in ram skipping gdi. it is faster and feels good to know you
wrote the same stuff gdi has in it.

of corse you have to use GDI to get it to the screen but atleast you
can do it all faster. and without loss of color.

Posted on 2006-04-27 22:53:28 by Zcoder

Infact I have wrote such proc's to resize inlarge image, shrink image
flip image, rotate image, brighten image, dim image, grayscale image
all done in ram skipping gdi. it is faster and feels good to know you
wrote the same stuff gdi has in it.

Any chance of you posting that code or portions of it, to see how its done?
Posted on 2006-04-28 00:34:01 by rags
Your wish is my command, the zip file I have posted contains
all the functions I have in regards to image manipulation.

All I ask is if you use it in a tool or something to give me some small
credit. except for the code in there that reads GIF's and JPG's that
I think was done by ernie? not sure. But all the rest was written by me
for use in some of my apps.

And if you modify it by optimizing it more then I did I would like a copy
or if you add more image manipulations to it I would like that too.

Posted on 2006-04-28 05:00:29 by Zcoder
Humm, the image shrinking seems a bit simplistic - no filtering of any kind?
Posted on 2006-04-28 05:04:46 by f0dder
I am not sure what you mean by filtering?

I shrunk it in reverse of how I did the inlarging and it
looked good to me, just as good as I see done by
other image veiwer I have.

could you explain more on filtering?

Posted on 2006-04-28 05:14:46 by Zcoder
As long as you only shrink in half (well, powers of two) you will get okay results. But if you need to, say, shrink a 1600x1200 image to 1024x768, you get an uneven shrink factor (something like 1:1.5652). Have a look at the attached image. It's a bit large because I saved it in PNG format, to avoid a lossy compression algorithm blurring out the differences. The image was resized from 1632x1232, and you'll need to zoom in to really see the difference...

Posted on 2006-04-28 05:31:05 by f0dder
I see now what you mean.
Most of the programs I have wont let me shrink or inlarge a file
by a uneven mark, one I have shows a slider and it jumps by two
and one I have that will let me do a odd mark value seems
to skim off a few pixles on one or 2 sides, couse the image
always winds up X2 or /2.

So I thought this is what they do, I never really tried to
do that, I just made the proc do it by 2 each time you call it.

I could try as you say and see what I come up with.

Posted on 2006-04-28 05:40:14 by Zcoder
Well, doing it properly requires a fair bit of code - and there's a fair amount of different ways to do it, which will give varying quality of results, depending on the source image, targer resolution et cetera. Bilinear and bicubic filtering, weighed average etc. There's a lot of research to do :), especially because one would generally want "subpixel accuracy".
Posted on 2006-04-28 08:19:55 by f0dder
Even shrinking by a factor of 2 looks *much* better when done via some smart filter (triangle/lanczos/etc.). Same goes to stretching.
Posted on 2006-04-28 10:14:32 by ti_mo_n
Well I can give it a shot, I am really good at finding away.
I have been working on one to blar a image, I took it out
of the download couse it's not working right yet, I use
a look ahead logo, Alpha blending to blar each scan line in the image
it kinda works, but needs improvements.

I have in my gamer folder wrote ray casting for use in DX surface rendering
so I know alot about dealing with pixels and colors.
ray casting of circels and squares and angles stuff like that so far.

Posted on 2006-04-28 10:42:58 by Zcoder
Thanks guys

The application is wrapped in plastic and are now sold.

Posted on 2006-05-02 07:51:54 by KetilO
Cool man, congrats!!!!!  8)

Posted on 2006-05-02 09:26:11 by Biterider
Interesting what is that applications? Video/Music rental, or online purchasing of those? Got a link to the product? :)
Posted on 2006-05-02 09:29:42 by f0dder
It is an addon for our POS system, an information kiosk for video rental/sale.
So fresh it's not on our website yet.


Posted on 2006-05-02 11:41:04 by KetilO
Nice, good work - hope you make a bit of cash from this :)

Also, the interface looks pretty nice - thumbs up.
Posted on 2006-05-02 11:46:51 by f0dder