473,325 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Generating Thumbnails (GetThumbnailImage) ...

Hi everyone,

I am trying to generate some thumbnails using System.Drawing.Image Class.
Actually the GetThumnailImage method. The question is: How can I get a
better thumbnail picture? I mean, when the original size is big, for
example, 800x600 and I generate a small picture (160x120) the quality is
terrible for a jpeg and even orse for a gif. How can I get some better
images? There is another class? There is some resolution propertie I can
set?

Thank you,

Fabrício Sperandio

Nov 18 '05 #1
8 3185
Are you really sure you want to generate thumbnails? The reason I ask is
that with HTML, you can set the visible properties of an image, so that it
is resized in the browser. If you use the same image (resized), and need to,
for example, click on the thumbnail to see the larger version of the image,
the larger version will already be cached, and will not have to be
downloaded (again). Not to mention the time you save with processing images
on the fly and HD space.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Fabricio Sperandio" <fa*****@cpd.ufsm.br.invalid> wrote in message
news:uB**************@tk2msftngp13.phx.gbl...
Hi everyone,

I am trying to generate some thumbnails using System.Drawing.Image Class.
Actually the GetThumnailImage method. The question is: How can I get a
better thumbnail picture? I mean, when the original size is big, for
example, 800x600 and I generate a small picture (160x120) the quality is
terrible for a jpeg and even orse for a gif. How can I get some better
images? There is another class? There is some resolution propertie I can
set?

Thank you,

Fabrício Sperandio

Nov 18 '05 #2
Yeah, I know...

But, what I was looking for is to show the small images faster... The
thumbnails image has 7KB and the original 20KB... And I was expecting to get
a better image than the orignal compressed with html properties...

Thank you dude...

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
Are you really sure you want to generate thumbnails? The reason I ask is
that with HTML, you can set the visible properties of an image, so that it
is resized in the browser. If you use the same image (resized), and need
to,
for example, click on the thumbnail to see the larger version of the
image,
the larger version will already be cached, and will not have to be
downloaded (again). Not to mention the time you save with processing
images
on the fly and HD space.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Fabricio Sperandio" <fa*****@cpd.ufsm.br.invalid> wrote in message
news:uB**************@tk2msftngp13.phx.gbl...
Hi everyone,

I am trying to generate some thumbnails using System.Drawing.Image Class.
Actually the GetThumnailImage method. The question is: How can I get a
better thumbnail picture? I mean, when the original size is big, for
example, 800x600 and I generate a small picture (160x120) the quality is
terrible for a jpeg and even orse for a gif. How can I get some better
images? There is another class? There is some resolution propertie I can
set?

Thank you,

Fabrício Sperandio


Nov 18 '05 #3
Oddly enough, I'm stuck with the same issue. I want to get better looking
Thumbnail images as well. Mostly the image needs a sharpen filter applied
to it. But I cannot find anywhere that shows "how" to sharpen an image.
I'm willing to do it pixel by pixel, but don't know the algorithm and have
spent all day today searching the internet for info and have been unable to
find an algorithm.
"Fabricio Sperandio" <fa*****@cpd.ufsm.br.invalid> wrote in message
news:uB**************@tk2msftngp13.phx.gbl...
Hi everyone,

I am trying to generate some thumbnails using System.Drawing.Image Class.
Actually the GetThumnailImage method. The question is: How can I get a
better thumbnail picture? I mean, when the original size is big, for
example, 800x600 and I generate a small picture (160x120) the quality is
terrible for a jpeg and even orse for a gif. How can I get some better
images? There is another class? There is some resolution propertie I can
set?

Thank you,

Fabrício Sperandio

Nov 18 '05 #4
Not to mention, not all browsers support the use of the <IMG attributes to
"resize" the image.

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
Are you really sure you want to generate thumbnails? The reason I ask is
that with HTML, you can set the visible properties of an image, so that it
is resized in the browser.
--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP

Nov 18 '05 #5
Fabricio Sperandio wrote:
I am trying to generate some thumbnails using System.Drawing.Image Class.
Actually the GetThumnailImage method. The question is: How can I get a
better thumbnail picture? I mean, when the original size is big, for
example, 800x600 and I generate a small picture (160x120) the quality is
terrible for a jpeg and even orse for a gif. How can I get some better
images? There is another class? There is some resolution propertie I can
set?


The problem, in a nutshell, is that GIF files are "dithered" and JPEG
images are not saved at a high enough quality. These faults can be
remedied with some rather complicated server-side code. Fortunately,
they have been solved and wrapped up in a nifty class for us to use.
For more information read this article:

Optimizing Color Quantization for ASP.NET Images
http://tinyurl.com/6zl8t

hth

--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
Nov 18 '05 #6
Although this is a great article, this is not what I am experiencing. I'm
seeing the image becoming blurry. No apparent loss of color. No issue with
jpeg compression artifacts. No grainyness. Just plain blurry as if a
"sharpen" filter needs to be applied. This occurs when I resize (shrink)
images using the GetThumbnailImage or when I save images using the
image\jpeg codec with an Encoder.Quality setting in the 80L range using the
image.Save

Any ideas?

"Scott Mitchell [MVP]" <mi******@4guysfromrolla.com> wrote in message
news:9A******************@newssvr21.news.prodigy.c om...
Fabricio Sperandio wrote:
I am trying to generate some thumbnails using System.Drawing.Image Class. Actually the GetThumnailImage method. The question is: How can I get a
better thumbnail picture? I mean, when the original size is big, for
example, 800x600 and I generate a small picture (160x120) the quality is
terrible for a jpeg and even orse for a gif. How can I get some better
images? There is another class? There is some resolution propertie I can
set?


The problem, in a nutshell, is that GIF files are "dithered" and JPEG
images are not saved at a high enough quality. These faults can be
remedied with some rather complicated server-side code. Fortunately,
they have been solved and wrapped up in a nifty class for us to use.
For more information read this article:

Optimizing Color Quantization for ASP.NET Images
http://tinyurl.com/6zl8t

hth

--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!

Nov 18 '05 #7
This happens to me when I fit an image disprportionally to the thumbnail
size. In other words, if you reduce the size of the image and maintain the
aspect ratio then it's not blurry. If you let the image fill the area
automatically, the image is not reduced with the aspect ratio maintained and
the blurriness results. Hope this makes sense.

"ESPN Lover" <es**@lover.com> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
Although this is a great article, this is not what I am experiencing. I'm
seeing the image becoming blurry. No apparent loss of color. No issue
with
jpeg compression artifacts. No grainyness. Just plain blurry as if a
"sharpen" filter needs to be applied. This occurs when I resize (shrink)
images using the GetThumbnailImage or when I save images using the
image\jpeg codec with an Encoder.Quality setting in the 80L range using
the
image.Save

Any ideas?

"Scott Mitchell [MVP]" <mi******@4guysfromrolla.com> wrote in message
news:9A******************@newssvr21.news.prodigy.c om...
Fabricio Sperandio wrote:
> I am trying to generate some thumbnails using System.Drawing.Image Class. > Actually the GetThumnailImage method. The question is: How can I get a
> better thumbnail picture? I mean, when the original size is big, for
> example, 800x600 and I generate a small picture (160x120) the quality
> is
> terrible for a jpeg and even orse for a gif. How can I get some better
> images? There is another class? There is some resolution propertie I
> can
> set?


The problem, in a nutshell, is that GIF files are "dithered" and JPEG
images are not saved at a high enough quality. These faults can be
remedied with some rather complicated server-side code. Fortunately,
they have been solved and wrapped up in a nifty class for us to use.
For more information read this article:

Optimizing Color Quantization for ASP.NET Images
http://tinyurl.com/6zl8t

hth

--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!


Nov 18 '05 #8
I have a ratio I resize to keeping the original aspect ratio. if the
original image is 800x600 and I resize it to a 200 pixel wide image, the
resulting height is 150.
"Pat Carden" <pc*****@bellsouth.nospam.net> wrote in message
news:OY*************@TK2MSFTNGP09.phx.gbl...
This happens to me when I fit an image disprportionally to the thumbnail
size. In other words, if you reduce the size of the image and maintain the aspect ratio then it's not blurry. If you let the image fill the area
automatically, the image is not reduced with the aspect ratio maintained and the blurriness results. Hope this makes sense.

"ESPN Lover" <es**@lover.com> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
Although this is a great article, this is not what I am experiencing. I'm seeing the image becoming blurry. No apparent loss of color. No issue
with
jpeg compression artifacts. No grainyness. Just plain blurry as if a
"sharpen" filter needs to be applied. This occurs when I resize (shrink) images using the GetThumbnailImage or when I save images using the
image\jpeg codec with an Encoder.Quality setting in the 80L range using
the
image.Save

Any ideas?

"Scott Mitchell [MVP]" <mi******@4guysfromrolla.com> wrote in message
news:9A******************@newssvr21.news.prodigy.c om...
Fabricio Sperandio wrote:
> I am trying to generate some thumbnails using System.Drawing.Image

Class.
> Actually the GetThumnailImage method. The question is: How can I get a > better thumbnail picture? I mean, when the original size is big, for
> example, 800x600 and I generate a small picture (160x120) the quality
> is
> terrible for a jpeg and even orse for a gif. How can I get some better > images? There is another class? There is some resolution propertie I
> can
> set?

The problem, in a nutshell, is that GIF files are "dithered" and JPEG
images are not saved at a high enough quality. These faults can be
remedied with some rather complicated server-side code. Fortunately,
they have been solved and wrapped up in a nifty class for us to use.
For more information read this article:

Optimizing Color Quantization for ASP.NET Images
http://tinyurl.com/6zl8t

hth

--

Scott Mitchell
mi******@4guysfromrolla.com
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!



Nov 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James | last post by:
Hi, I'm a newbie to VB.NET and I am trying to create thumbnails from .jpg files (my travel pictures) to post on a website. I want to create an executable that I can put in a directory containing...
0
by: Ken | last post by:
Hi all: I have created a vb.net service that watches a directory and when an image is placed in the directory a thumbnail of the image is created. The problem I am having is a...
3
by: Vagabond Software | last post by:
I'm trying to display thumbnail images in a Listview that look more like the Windows thumbnail view. Everything is working pretty good, but my thumbnails are decidedly not like the Windows...
2
by: Jon | last post by:
Hi, I've got 10 image thumbnails generated with GetThumbnailImage down the side of each page of a site. However it seems the thumbnails are being re-generated with every page request rather than...
5
by: Daniel | last post by:
hi, I have a whole lot of pictures needed to transform to the thumbnails to display on the web, it there any easy to do? Thanks.
2
by: IkBenHet | last post by:
Hello, I want to make thumbnails from images. I found this code and modified it and it works fine: <%@Import Namespace="System.Drawing.Imaging" %> <script language="VB" runat="server">...
6
by: Rich | last post by:
Hello, I want to simulate the dynamic thumbnail display of Windows Explorer (winxp) on a form or pannel container. If I place a picture box on my container form/pannel and dimension it to the...
1
by: pmo | last post by:
I need to read in some images from file. Display them as thumbnails in a form. The user is then supposed to rearrange them in somehow, dragging thumbnails with the mouse or marking one or several...
5
by: sejal17 | last post by:
Hello Friends, I want Application that displays an image preview of a Word document (Like thumbnail View of word document) Following is my code but i got error on bold part of code ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.