BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Antialiased TImageList
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Laggy
Guest





PostPosted: Mon Apr 30, 2007 8:59 pm    Post subject: Antialiased TImageList Reply with quote



Hi,

Was wondering if anyone knew how to make images within a TImageList
antialised (i.e. looking smoother and more blended?) say at startup.

I currently use the ConvertTo32BitImagelist procedure to allow the showing
of higher colour images but want to find a way of making historical images
in TImageLists that have been around a few years appear not so harsh looking
on XP and Vista.

I dont mind if there has to be some pre-processing in the Form Create to
take them out one by one, antialias them (if the right term to use) and put
them back in the TImageLists to use in Treeviews. etc.

Does anyone have any code or any examples on how to do this? I am a Delphi
graphics newbie.

Thanks.
Back to top
Jens Gruschel
Guest





PostPosted: Mon Apr 30, 2007 9:25 pm    Post subject: Re: Antialiased TImageList Reply with quote



Quote:
Was wondering if anyone knew how to make images within a TImageList
antialised (i.e. looking smoother and more blended?) say at startup.

Take a look at http://www.thany.org/article/32/PngComponents

--
Jens Gruschel
http://www.pegtop.net
Back to top
Laggy
Guest





PostPosted: Tue May 01, 2007 1:13 pm    Post subject: Re: Antialiased TImageList Reply with quote



Thanks Jens for the link.

So if i changed the declaration of the TImageLists in the pas and dfm
manually, would it retain the images using this new component and would they
automatically become antialiased or alphablended (which ever is the correct
term) on my forms under xp and vista?

Cheers.

"Jens Gruschel" <nospam (AT) thisurldoesnotexist (DOT) com> wrote in message
news:46361892$1 (AT) newsgroups (DOT) borland.com...
Quote:
Was wondering if anyone knew how to make images within a TImageList
antialised (i.e. looking smoother and more blended?) say at startup.

Take a look at http://www.thany.org/article/32/PngComponents

--
Jens Gruschel
http://www.pegtop.net
Back to top
Jens Gruschel
Guest





PostPosted: Tue May 01, 2007 1:36 pm    Post subject: Re: Antialiased TImageList Reply with quote

Quote:
So if i changed the declaration of the TImageLists in the pas and dfm
manually, would it retain the images using this new component and would they
automatically become antialiased or alphablended (which ever is the correct
term) on my forms under xp and vista?

No, your images lack this information. You have to create a new image
list and add images with have an alpha channel and which use this alpha
channel for antialiasing. To provide such images the png format is used
because png is the most common format which supports RGBA officially.
You can create such images with image editing software like Photoshop
and save them as png files or search the web for png images. Here is one
example I like: http://www.famfamfam.com/lab/icons/silk/ (however it's
limited to 16x16)

--
Jens Gruschel
http://www.pegtop.net
Back to top
Laggy
Guest





PostPosted: Tue May 01, 2007 1:37 pm    Post subject: Re: Antialiased TImageList Reply with quote

Well I have just tried and the answer is a resounding no lol

I dont want to make the 60 odd glyphs into png images and add them into the
pngimagelist.

Is there a way i can pre-parse them in the imagelist at startup using any
other graphic routines?

I hope someone has some tips :)

Cheers.

"Laggy" <nospam (AT) nospam (DOT) com> wrote in message
news:4636f6cc$1 (AT) newsgroups (DOT) borland.com...
Quote:
Thanks Jens for the link.

So if i changed the declaration of the TImageLists in the pas and dfm
manually, would it retain the images using this new component and would
they automatically become antialiased or alphablended (which ever is the
correct term) on my forms under xp and vista?

Cheers.

"Jens Gruschel" <nospam (AT) thisurldoesnotexist (DOT) com> wrote in message
news:46361892$1 (AT) newsgroups (DOT) borland.com...
Was wondering if anyone knew how to make images within a TImageList
antialised (i.e. looking smoother and more blended?) say at startup.

Take a look at http://www.thany.org/article/32/PngComponents

--
Jens Gruschel
http://www.pegtop.net

Back to top
Laggy
Guest





PostPosted: Tue May 01, 2007 1:38 pm    Post subject: Re: Antialiased TImageList Reply with quote

Thanks jens for the very fast reply!

"Jens Gruschel" <nospam (AT) nospam (DOT) nospam> wrote in message
news:4636fc19 (AT) newsgroups (DOT) borland.com...
Quote:
So if i changed the declaration of the TImageLists in the pas and dfm
manually, would it retain the images using this new component and would
they automatically become antialiased or alphablended (which ever is the
correct term) on my forms under xp and vista?

No, your images lack this information. You have to create a new image list
and add images with have an alpha channel and which use this alpha channel
for antialiasing. To provide such images the png format is used because
png is the most common format which supports RGBA officially. You can
create such images with image editing software like Photoshop and save
them as png files or search the web for png images. Here is one example I
like: http://www.famfamfam.com/lab/icons/silk/ (however it's limited to
16x16)

--
Jens Gruschel
http://www.pegtop.net
Back to top
David Ninnes
Guest





PostPosted: Tue May 01, 2007 2:37 pm    Post subject: Re: Antialiased TImageList Reply with quote

Laggy wrote:
Quote:
Well I have just tried and the answer is a resounding no lol

I dont want to make the 60 odd glyphs into png images and add them into the
pngimagelist.

Is there a way i can pre-parse them in the imagelist at startup using any
other graphic routines?


You can, by writing a little routine to convert the transparent color

from the imagelist bitmaps to convert them to PNG's with an alpha
channel. But they won't look any different. To get the effect I think
you're after you need icons with an alpha channel, you can buy some or
make some as Jens suggested.

If you have the original images for the icons in a large size you can
shrink them to icon size and this will give you an alpha blended image,
something like The Gimp or Photoshop will let you do this.

hth,
Dave
Back to top
Laggy
Guest





PostPosted: Tue May 01, 2007 6:12 pm    Post subject: Re: Antialiased TImageList Reply with quote

Hi helmut - yes something like that and more specifically the call
Choixfiltre(1); which is for antialiasing within the code and would be
perfect i think for my needs. I changed the Soften button in the demo from
Choixfiltre(2); to Choixfiltre(1); and opened up a bitmap and it smoothed it
great.

However there is the issue of trying to modify all the code for my needs
only - passing in a standard 16x16 bitmap and returning an antialiased 16x16
bitmap.

I have tried to pull the code out to no avail as it is tied in all over the
place and rather confusing in places too.

Does anyone know of a similar routine or has anyone created a function to do
this from the Estampe codeline?

Cheers.


"helmut" <helmut1000 (AT) gmail (DOT) com> wrote in message
news:46373112 (AT) newsgroups (DOT) borland.com...
Quote:

"Laggy" <nospam (AT) nospam (DOT) com> wrote in message
news:46361278$1 (AT) newsgroups (DOT) borland.com...
Hi,

Was wondering if anyone knew how to make images within a TImageList
antialised (i.e. looking smoother and more blended?) say at startup.

I currently use the ConvertTo32BitImagelist procedure to allow the
showing of higher colour images but want to find a way of making
historical images in TImageLists that have been around a few years appear
not so harsh looking on XP and Vista.

I dont mind if there has to be some pre-processing in the Form Create to
take them out one by one, antialias them (if the right term to use) and
put them back in the TImageLists to use in Treeviews. etc.

Does anyone have any code or any examples on how to do this? I am a
Delphi graphics newbie.

Thanks.



you mean a blur routine.
http://www.efg2.com/Lab/Library/Delphi/Graphics/Queinec/EstampeDemo/EstampeDemo.htm
Back to top
helmut
Guest





PostPosted: Wed May 02, 2007 4:22 am    Post subject: Re: Antialiased TImageList Reply with quote

"Laggy" <nospam (AT) nospam (DOT) com> wrote in message
news:46361278$1 (AT) newsgroups (DOT) borland.com...
Quote:
Hi,

Was wondering if anyone knew how to make images within a TImageList
antialised (i.e. looking smoother and more blended?) say at startup.

I currently use the ConvertTo32BitImagelist procedure to allow the showing
of higher colour images but want to find a way of making historical images
in TImageLists that have been around a few years appear not so harsh
looking on XP and Vista.

I dont mind if there has to be some pre-processing in the Form Create to
take them out one by one, antialias them (if the right term to use) and
put them back in the TImageLists to use in Treeviews. etc.

Does anyone have any code or any examples on how to do this? I am a
Delphi graphics newbie.

Thanks.



you mean a blur routine.

http://www.efg2.com/Lab/Library/Delphi/Graphics/Queinec/EstampeDemo/EstampeDemo.htm
Back to top
Laggy
Guest





PostPosted: Wed May 02, 2007 1:43 pm    Post subject: Re: Antialiased TImageList Reply with quote

Well not being a graphics developer I have given it a go and come up with
the little demo prog in the borland.public.attachments folder called
AntiAliasImageList.zip The code is cobbled together from code i found all
over the net yesterday.

It is definatelty moving along the right lines which i am amazed at, however
there are two issues i really need help with...

Firstly, the images seem too sampled if you see what i mean when you run the
exe. Ideally I would like them antialiased to about half the level they are
now.

Secondly, when the images are antialiased, they have a white background
which i dont want - i want to ideally keep the same background.

If any of the delphi gurus on here could help me out i would really
appreciate it.

Cheers.


"Laggy" <nospam (AT) nospam (DOT) com> wrote in message
news:46373ca2$1 (AT) newsgroups (DOT) borland.com...
Quote:
Hi helmut - yes something like that and more specifically the call
Choixfiltre(1); which is for antialiasing within the code and would be
perfect i think for my needs. I changed the Soften button in the demo
from Choixfiltre(2); to Choixfiltre(1); and opened up a bitmap and it
smoothed it great.

However there is the issue of trying to modify all the code for my needs
only - passing in a standard 16x16 bitmap and returning an antialiased
16x16 bitmap.

I have tried to pull the code out to no avail as it is tied in all over
the place and rather confusing in places too.

Does anyone know of a similar routine or has anyone created a function to
do this from the Estampe codeline?

Cheers.


"helmut" <helmut1000 (AT) gmail (DOT) com> wrote in message
news:46373112 (AT) newsgroups (DOT) borland.com...

"Laggy" <nospam (AT) nospam (DOT) com> wrote in message
news:46361278$1 (AT) newsgroups (DOT) borland.com...
Hi,

Was wondering if anyone knew how to make images within a TImageList
antialised (i.e. looking smoother and more blended?) say at startup.

I currently use the ConvertTo32BitImagelist procedure to allow the
showing of higher colour images but want to find a way of making
historical images in TImageLists that have been around a few years
appear not so harsh looking on XP and Vista.

I dont mind if there has to be some pre-processing in the Form Create to
take them out one by one, antialias them (if the right term to use) and
put them back in the TImageLists to use in Treeviews. etc.

Does anyone have any code or any examples on how to do this? I am a
Delphi graphics newbie.

Thanks.



you mean a blur routine.
http://www.efg2.com/Lab/Library/Delphi/Graphics/Queinec/EstampeDemo/EstampeDemo.htm


Back to top
David Ninnes
Guest





PostPosted: Thu May 03, 2007 3:59 am    Post subject: Re: Antialiased TImageList Reply with quote

Laggy wrote:
Quote:

Firstly, the images seem too sampled if you see what i mean when you run the
exe. Ideally I would like them antialiased to about half the level they are
now.


You could try putting the original image (or a ratio of the pixels in
the original image) back on top of the blurred image, that might give
you more definition. Or maybe add the two images together with a ratio
between the blurred image and the original image.

hth,
Dave
Back to top
Laggy
Guest





PostPosted: Thu May 03, 2007 1:17 pm    Post subject: Re: Antialiased TImageList Reply with quote

Thanks for the suggestions David :)

Though as i mentioned in my very first post, i am not a graphics developer
at all so would not have a clue as to how I would go about doing that.

Can anybody shed some light or does anyone have an improved antialias
function than the one in my demo in b.p.a?

Cheers.


"David Ninnes" <david_ninnes (AT) hotmail (DOT) com> wrote in message
news:46391818 (AT) newsgroups (DOT) borland.com...
Quote:
Laggy wrote:

Firstly, the images seem too sampled if you see what i mean when you run
the exe. Ideally I would like them antialiased to about half the level
they are now.


You could try putting the original image (or a ratio of the pixels in the
original image) back on top of the blurred image, that might give you more
definition. Or maybe add the two images together with a ratio between the
blurred image and the original image.

hth,
Dave
Back to top
Jens Gruschel
Guest





PostPosted: Sun May 06, 2007 5:56 pm    Post subject: Re: Antialiased TImageList Reply with quote

Quote:
Can anybody shed some light or does anyone have an improved antialias
function than the one in my demo in b.p.a?

You are trying to generate information that's not available. To allow
subpixel accuracy antialiasing algorithmns require the information
what's between the pixel grid. This information is either provided by a
continuous mathematical description of the object (say a line or a
circle) or by a matrix with higher resolution. Latter algorithmns are
known as resampling. What you actually do isn't antialiasing at all,
it's blurring, and like all filter operations blurring cannot generate
more information than the one in the source bitmap. Like antialiasing
blurring creates semi transparent pixels at the edges, but blurring also
eleminates the high frequencies within your image. So to provide a high
quality antialiased icon you need a source icon with higher resolution.

--
Jens Gruschel
http://www.pegtop.net
Back to top
Herre de Jonge
Guest





PostPosted: Mon May 07, 2007 7:09 am    Post subject: Re: Antialiased TImageList Reply with quote

David Ninnes wrote:
Quote:
Laggy wrote:
Well I have just tried and the answer is a resounding no lol

I dont want to make the 60 odd glyphs into png images and add them
into the pngimagelist.

Is there a way i can pre-parse them in the imagelist at startup using
any other graphic routines?


You can, by writing a little routine to convert the transparent color
from the imagelist bitmaps to convert them to PNG's with an alpha
channel. But they won't look any different.

Isn't it easier to just save the images to a file? They
will end up in one .bmp with a lovely magenta as transparent
colour. Use your favourite editing program to change this
to a png with transparency and load them back into the new
component? (But you're right... this won't change the look
of these old, original icons). No need to write any routines.

Take care,
Herre
Back to top
Jens Gruschel
Guest





PostPosted: Tue May 08, 2007 12:03 am    Post subject: Re: Antialiased TImageList Reply with quote

Quote:
So to provide a high
quality antialiased icon you need a source icon with higher resolution.

Wait a minute. Although I still believe that for really high quality
antialiased icons you need high resolution (non-antialiased) images,
maybe there is one thing you can do with small images: convert your
icons to 32 bit with alpha channel using the transparent color, than
blur the alpha channel only and repeat the RGB values of the edge pixels
in the semi-transparent areas (you probably need to find a tricky
algorithm for this step). Haven't tried it, but might be a suitable way.


--
Jens Gruschel
http://www.pegtop.net
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.