Hi Kdo and thanks for your comment.
I think the problem is when i use the StretchDraw function.
//m_picture is a TJPEGImage
Graphics::TBitmap *bmp = new Graphics::TBitmap();
bmp->Width = newWidth;
bmp->Height = newHeight;
bmp->Canvas->StretchDraw(b
m_picture->Assign(bmp);
m_picture->SaveToFile(m_pi
Look at this images that i made, the former is made by this function but the latter is resized in Photoshop. Both are created from the same picture.
http://www.designplastik.c
http://www.designplastik.c
See e.g. how his nose gets all distorted.
Thanks.
Main Topics
Browse All Topics





by: KdoPosted on 2003-03-10 at 19:12:12ID: 8108221
The VCL doesn't offer you a lot of options when dealing with jpegs. It's a "basic" class that has few options.
You'll have to deal with a jpg as any other graphical entity. Load it to a canvas, dink with the picture, and save it. It sounds like you're doing that.
So now we get into picture quality -- the root of the problem.
If you select "best picture quality" you're sacrificing wall time for a better image. If you're going to resize the picture several times I highly recommend this.
jp = new TJPEGImage();
jp->CompressionQuality = 50;
For most of the things that I do this is good enough. It may not be for your purposes.
And the problem is the mathematics involved. Every time the picture is compress or resized, part of the picture is left on the cutting room floor. Some resizing works quite well, others causes distortion. Cut a picture's dimensions in half. Since the new picture contains 1/4 the pixels of the original the new pic is obviously smaller. Now blow the picture back up to it's original size. Depending upon the quality of the 1/2 sized picture, the new picture may look distorted or blurry. After all the mathematics filled in the missing pixels based on the pixels around it. It had to "make them up" by guessing. The "guesses" are reasonably good, but not as good as an undoctored image.
For now, try the best quality compression that you can. If this isn't good enough you'll have to invest in some 3rd party imaging software that will sharpen the image for you.
Kdo