Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2006, 04:18 PM
Cliff Cliff is offline
Senior Member
 
Join Date: Mar 2004
Posts: 373
Default TImage.canvas.TextOut to TJpegImage---poor text quality

Hi!
I am adding text to a Timage.Canvas and then
saving as a Jpg.
My text and border lines are then showing a halo
or bleeding affect that is not acceptable. Will
antialiasing help , and if so how do I incorporate it?
Or
is there another way to add text?
I could create a seperate image with only the text and borders
and then blit it the the original image but I think the
jpeg flaws would still show.
Thanks, Cliff
Reply With Quote
  #2  
Old 01-17-2006, 04:28 PM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default RE: TImage.canvas.TextOut to TJpegImage---poor text quality

Try setting the TJPEGImage to better quality, have a look at the CompressionQuality and the Performance properties in the Help file.

gLes
Reply With Quote
  #3  
Old 01-17-2006, 04:29 PM
SourceCode SourceCode is offline
Senior Member
 
Join Date: Apr 2005
Posts: 810
Default RE: TImage.canvas.TextOut to TJpegImage---poor text quality

jpeg is generally a low quality image format.

Try exporting to a Bitmap instead.
Reply With Quote
  #4  
Old 01-17-2006, 04:48 PM
Cliff Cliff is offline
Senior Member
 
Join Date: Mar 2004
Posts: 373
Default RE: TImage.canvas.TextOut to TJpegImage---poor text quality

Thanks for the input!
Saving as a gif works except for the lack of color depth.
I am trying to get the size in Kbs down as small as possible.
The gif is at 430 kb.
A jpg at 80 % compression is 165 Kb with Ok but not great quality.
I was hoping for 45 to 60 Kbs.

it looks like the red color bleeds the most if there are no
other options I could dump the reds.
Cliff
Reply With Quote
  #5  
Old 01-17-2006, 08:31 PM
SourceCode SourceCode is offline
Senior Member
 
Join Date: Apr 2005
Posts: 810
Default RE: TImage.canvas.TextOut to TJpegImage---poor text quality

Who will look for very long at a low quality jpeg image if the color range is limited or unless the jpeg images are very smalll then you might as well make the images bitmaps. Just curious what are using the images for?
Reply With Quote
  #6  
Old 01-18-2006, 03:41 AM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default RE: TImage.canvas.TextOut to TJpegImage---poor text quality

Do these images have peculiar characteristics? Because JPEGs are mostly for natural like images (even digital blasphemy ), since the loss of image quality isn't noticable, GIF is rather for the web, where there is no big need for higher color depths, for more artificial images which e.g. contain text you should consider using 24-bit PNGs, which in some cases produce marvelously small files ofcourse without the loss of quality

[link]http://pngdelphi.sourceforge.net/[/link]

Hope that helps

gLes
Reply With Quote
  #7  
Old 01-18-2006, 05:31 AM
Cliff Cliff is offline
Senior Member
 
Join Date: Mar 2004
Posts: 373
Default RE: TImage.canvas.TextOut to TJpegImage---poor text quality

The images are aerial photos. In Bmp format they are
1,000Kb+ which is way to large. The text that is added describes source, resolution, lat, lon, ect. The display
sizes vary from 1/4 page to full page.
Reply With Quote
  #8  
Old 01-18-2006, 06:32 AM
Cliff Cliff is offline
Senior Member
 
Join Date: Mar 2004
Posts: 373
Default RE: TImage.canvas.TextOut to TJpegImage---poor text quality

Png does a nice job.
Here are the results:

PNG 707 KB
JPG at 80% 165 KB
GIF 430 KB

for my current use I will go with the JPG 80% and
remove red color from my added text.
Thanks gLes & SourceCode
Reply With Quote
  #9  
Old 01-18-2006, 06:43 PM
krjt krjt is offline
Senior Member
 
Join Date: Oct 2005
Posts: 203
Default RE: TImage.canvas.TextOut to TJpegImage---poor text quality

You may like to try JPEG library available at this site:
It is commercial one but they say it is free for personal use.
http://www.betterjpeg.com/jpeg-library.htm

Better JPEG library features:
Lossless JPEG Transformations - Rotation, Flip
Lossless JPEG Crop
Lossless JPEG Canvas enlargement
Partial JPEG modification without full recompression - client application simply modifies a bitmap, the library identifies the changes and recompresses changed areas
Embedded Undo/Redo support
EXIF support (access to parameters, thumbnail refresh)
Compression optimization

I have not used it myself.

Accept as answer if it helps.
Reply With Quote
  #10  
Old 01-19-2006, 05:02 AM
Cliff Cliff is offline
Senior Member
 
Join Date: Mar 2004
Posts: 373
Default RE: TImage.canvas.TextOut to TJpegImage---poor text quality

thanks krjt,
but the developer version is too$$ for me.
Cliff
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 07:05 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2017, vBulletin Solutions, Inc.