 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
mindsleep Guest
|
Posted: Sun Oct 16, 2005 9:59 am Post subject: Resizing images? |
|
|
Hi!
I have googled the groups on how to resize an image. I need to resize
images (PNG, JPEG and GIF) in my program. All i have found are bad ways
of doing this, i tried them and the quality of a image when resized is
very bad (decreased size).
I also found various ways to do this, but in newer Delphi appz (.NET,
Delphi 9 etc.)
I use Delphi 5, and i need a way to resize the images (decrease). Can
someone publish some code on how to do this.
Thanx in advance,
Mindsleep
|
|
| Back to top |
|
 |
theo Guest
|
Posted: Sun Oct 16, 2005 10:44 am Post subject: Re: Resizing images? |
|
|
mindsleep schrieb:
| Quote: | Hi!
I have googled the groups on how to resize an image. I need to resize
images (PNG, JPEG and GIF) in my program. All i have found are bad ways
of doing this, i tried them and the quality of a image when resized is
very bad (decreased size).
I also found various ways to do this, but in newer Delphi appz (.NET,
Delphi 9 etc.)
I use Delphi 5, and i need a way to resize the images (decrease). Can
someone publish some code on how to do this.
Thanx in advance,
Mindsleep
|
You could try the Stretch procedures in
http://www.lischke-online.de/GraphicEx.php
|
|
| Back to top |
|
 |
Jeremy Darling Guest
|
Posted: Sun Oct 16, 2005 3:28 pm Post subject: Re: Resizing images? |
|
|
Look at borland.public.attachments for a post called "Bitmap linear
resample -> BASM (nt)" by Eric G. It will have everything you need and
gives a quality resize. Their are also many topics on this in the
borland.public.delphi.language.basm NG with source appearing in the b.p.a
group.
Jeremy
|
|
| Back to top |
|
 |
Mat Ballard Guest
|
Posted: Sun Oct 16, 2005 11:29 pm Post subject: Re: Resizing images? |
|
|
mindsleep wrote:
| Quote: | I have googled the groups on how to resize an image. I need to resize
images (PNG, JPEG and GIF) in my program. All i have found are bad ways
of doing this, i tried them and the quality of a image when resized is
very bad (decreased size).
I also found various ways to do this, but in newer Delphi appz (.NET,
Delphi 9 etc.)
I use Delphi 5, and i need a way to resize the images (decrease). Can
someone publish some code on how to do this.
|
Anders Melander's resample.pas is what you need.
Anders' original website is gone, so i've uploaded a copy to
nntp:borland.public.attachments
cheers,
Mat
|
|
| Back to top |
|
 |
Herre de Jonge Guest
|
Posted: Mon Oct 17, 2005 8:16 am Post subject: Re: Resizing images? |
|
|
I always use the GDI+ for this kind of thing. JEDI has
a project with a translation of the header files. Also
the Microsoft help is somewhere available as .chm (but
I don't remember where).
Take care,
Herre
|
|
| Back to top |
|
 |
Renate Schaaf Guest
|
Posted: Mon Oct 17, 2005 7:52 pm Post subject: Re: Resizing images? |
|
|
In article <4352e1c0$1 (AT) newsgroups (DOT) borland.com>, Mat Ballard wrote:
| Quote: | Anders Melander's resample.pas is what you need.
Anders' original website is gone, so i've uploaded a copy to
|
The algorithm isn't quite right. You see it, when the scale target ->
source is less than 2. Then it becomes obvious that the averaging
weights don't always sum up to 1, causing artificial lines in the
result. While this can be easily fixed, Eric Grange (BitmapResample)
and Mike Lischke (GraphicEx) got it right for now. I'm working on a
fair validation procedure for downsampling algorithms. I'll post
something soon in languages.basm and attachments. Help/ideas most
welcome, in the end we'll all profit from this.
Renate
|
|
| Back to top |
|
 |
Joris Van Damme Guest
|
Posted: Tue Oct 18, 2005 11:35 pm Post subject: Re: Resizing images? |
|
|
Renate Schaaf wrote:
| Quote: | I'm working on a
fair validation procedure for downsampling algorithms.
|
If I understand you correctly, I would like to suggest you add the folowing
test to your validation procedure: a 180 degrees rotation, of a downsample,
of an 180 degrees rotation, of the original, should match the downsample of
the original. If there's no match, this means the downsampling algorithm got
its coordinate mapping wrong, and thus there's an unwanted shift towards
right or left and top or bottom. (Anders' code doesn't pass this test. I
don't know about the corrected version from Eric and Mike.)
Joris Van Damme
[email]info (AT) awaresystems (DOT) be[/email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html
|
|
| Back to top |
|
 |
Mat Ballard Guest
|
Posted: Wed Oct 19, 2005 11:22 pm Post subject: Re: Resizing images? |
|
|
thanks Renate !
i hadn't checked the results of Ander's algorithm sufficiently thoroughly to
identify this problem,
cheers,
Mat
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|