Re: Sharpen an Image File
- From: "Casey Provance" <casey@xxxxxxxxxxx>
- Date: Thu, 19 May 2005 10:21:44 -0400
I've been using GDI+ now for a few months so I can have my way with images,
and it is an excellent solution...and yes, if not used properly, things can
backfire. GDI+ calls need a few levels of init, and each level needs to be
released...but once it's running you can do great things with it.
Oh yeah, the kicker...one must include the GDI "runtime" and install it into
the local folder (and not install it on XP). The file is a little over 1
MB.
Is it worth it? Well, you decide. :)
- Kev
"Mike D Sutton" <EDais@xxxxxxxx> wrote in message
news:ufaow3FXFHA.628@xxxxxxxxxxxxxxxxxxxxxxx
>> I have an image file that I am stretching proportionately (height and
>> width), but the result is a slightly blurred image. Is there any APIs I
>> can
>> use that would somehow sharpen the image or anti-alias it slightly.
>>
>> Yours more in hope than expectation! Thanks again for the support of the
>> group.
>
> AFAIK there is something in GDI+ but people seem to have a great deal of
> problems using it from the number of posts
> about it on the GDI groups, so your alternative is to write the filter
> yourself - Have a look at the "Edge detection /
> Edge snap / Filter kernel" demo on my site which includes a generic filter
> kernel class that can be set to a sharpen
> matrix. The SetSharpen() method of the class set's this kernel up for you
> and looks something like this:
>
> -1 -1 -1
> -1 9 -1
> -1 -1 -1
>
> The centre weight must be one higher than the sum of the surrounding
> values (otherwise you end up with an edge-detection
> kernel rather than an edge enhancement kernel), however if you find the
> effect too sharp then drop the surrounding
> values towards 0 and re-weight the kernel to 1, you can do this by calling
> SetSharpen() with an input weight of less
> than 1. Obviously calling it with an input weight of more than 1 enhances
> the effect, but can lead to some strange
> results when going too high.
> Hope this helps,
>
> Mike
>
> P.s. If you scale your image with the Halftone interpolation mode set then
> the scaling algorithm performs some degree of
> edge sharpening for you.
>
>
> - Microsoft Visual Basic MVP -
> E-Mail: EDais@xxxxxxxx
> WWW: Http://EDais.mvps.org/
>
>
.
- Follow-Ups:
- Re: Sharpen an Image File
- From: Mike D Sutton
- Re: Sharpen an Image File
- References:
- Sharpen an Image File
- From: Alastair MacFarlane
- Re: Sharpen an Image File
- From: Mike D Sutton
- Sharpen an Image File
- Prev by Date: Re: Compress captured videoframe
- Next by Date: Re: Sharpen an Image File
- Previous by thread: Re: Sharpen an Image File
- Next by thread: Re: Sharpen an Image File
- Index(es):
Relevant Pages
|