Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

extract thumbnails from jpeg

168 views
Skip to first unread message

Daniil

unread,
Apr 30, 2002, 7:37:52 PM4/30/02
to
Hi,

I'm writing a program to show grid of images as a preview. Since I'm working
with huge size images (JPEGs only) resize takes long time. Resently I found
out there is a way to extract a thumbnail from JPEG file itself so no resize
is needed.

Does anyone know how to do that!?

Thank you,

Daniil
dan...@NYCfoto.com

David J Taylor

unread,
May 1, 2002, 2:31:08 AM5/1/02
to
Set the Scale property - probably before reading.

David

Daniil

unread,
May 1, 2002, 10:07:57 AM5/1/02
to
Before I load it into TJPEGImage?

"David J Taylor" <david...@writeme.com> wrote in message
news:3ccf8bab$1_2@dnews...

David J Taylor

unread,
May 1, 2002, 10:47:44 AM5/1/02
to
Try it and see!

"Daniil" <dan...@NYCfoto.com> wrote in message news:3ccff70e$1_2@dnews...

Daniil

unread,
May 1, 2002, 11:29:11 AM5/1/02
to
WOW! It lightning fast and worx!!!

Thank you very much!


"David J Taylor" <david...@writeme.com> wrote in message

news:3cd00010$1_1@dnews...

David J Taylor

unread,
May 1, 2002, 12:20:38 PM5/1/02
to
I told you it would....

"Daniil" <dan...@NYCfoto.com> wrote in message news:3cd00a18$1_1@dnews...

Nils

unread,
May 1, 2002, 10:47:09 PM5/1/02
to
The scale helps (esp. jsEighth) but it is not the same as the thumbnail that
is present in *some* JPG files.

This thumbnail is part of the EXIF spec, search for EXIF SPEC JEIDA and
download the latest spec there if you want to use it. Problem is sometimes
that this thumbnail is not rotated while the main pic is.

Kind regards,

Nils
www.abc-view.com

David J Taylor <david...@writeme.com> wrote in message
news:3ccf8bab$1_2@dnews...

David J Taylor

unread,
May 2, 2002, 2:54:28 AM5/2/02
to
Nils,

Thanks for that reminder - you are right. Depends if the user really
wants "The Thumbnail" or just a reduced resolution image to use as a
thumbnail!

Cheers,
David

"Nils" <n.h...@quicknet.nl> wrote in message news:3cd0a77d$1_2@dnews...

Daniil

unread,
May 2, 2002, 2:16:05 PM5/2/02
to
How does this scale works? Why is it so fast?

"Nils" <n.h...@quicknet.nl> wrote in message news:3cd0a77d$1_2@dnews...

David J Taylor

unread,
May 2, 2002, 5:20:31 PM5/2/02
to
Essentially, it relies on the fact that JPEG are stored as 8 x 8 blocks,
with the block being transformed from the spatial to the spatial frequency
domain via some complex maths called the Discrete Cosine Transform (DCT).
Thus the average brightness of the 8 x 8 block is the "DC" component of
the spatial frequency domain.

This means that, in essence, by reading every 8th component horizontally
and vertically, one 64th of the data, you can get the entire image as a
thumbnail **without having to do any DCT maths** to recover the 64
individual pixels in that region. Hence the speed!

I hope that helps,
David

"Daniil" <dan...@NYCfoto.com> wrote in message news:3cd182ca$1_1@dnews...

Daniil

unread,
May 3, 2002, 11:16:06 AM5/3/02
to
interesting... is that what all those applications use to resize images?
maybe you know of any library that can resize very fast using Lanczos3 or
Mitchell filters?

"David J Taylor" <david...@writeme.com> wrote in message

news:3cd1ad9e$1_2@dnews...

David J Taylor

unread,
May 3, 2002, 1:57:12 PM5/3/02
to
No, resizing or resampling an image will be outside the JPEG internals.

Personally I use the free Intel Image Processing library DLLs which are
super-fast and take advantage of the MMX/SSE etc. processor instruction
sets. I wrote a wrapper so that it can be used from a TBitmap-like
object.

Cheers,
David

"Daniil" <dan...@NYCfoto.com> wrote in message news:3cd2aa1e_1@dnews...

Daniil

unread,
May 3, 2002, 2:45:50 PM5/3/02
to
Any chance you can give a wrapper :)

its just that i need to write program to resize a lot of pictures for my
gallery. but finding any good and fast resizing library proved to be very
hard. the one i'm using now generates beautiful thumbnails with Photoshop
quality, but its quite slow. thus i'm still on lookout.

"David J Taylor" <david...@writeme.com> wrote in message

news:3cd2cf78_1@dnews...

David J Taylor

unread,
May 3, 2002, 3:25:30 PM5/3/02
to
Sorry, it's proprietary.

David

"Daniil" <dan...@NYCfoto.com> wrote in message news:3cd2db46$1_1@dnews...

Daniil

unread,
May 3, 2002, 3:28:05 PM5/3/02
to
was worth a shot

thank you for explanations and help :)

"David J Taylor" <david...@writeme.com> wrote in message

news:3cd2e42a_2@dnews...

David J Taylor

unread,
May 3, 2002, 4:10:57 PM5/3/02
to
The Intel stuff does come with a Delphi demo...

http://developer.intel.com/software/products/perflib/ipl/index.htm

"Daniil" <dan...@NYCfoto.com> wrote in message news:3cd2e52d$1_1@dnews...

Daniil

unread,
May 3, 2002, 5:19:20 PM5/3/02
to
Yes, i did take a look at it. Nice and fast except delphi sample won't
compile on Delphi 6. So I guess there will be lots of swears before I manage
to understand how to use it :)

thanx

"David J Taylor" <david...@writeme.com> wrote in message

news:3cd2eed0$1_2@dnews...

Nils

unread,
May 3, 2002, 6:33:57 PM5/3/02
to
Hi Danii

Just load a JPEG at jsEighth and then use LanczosIII resampling to generate
the thumbnail.
However, make sure that the size of the resulting JPG image is still bigger
in both dimensions as your target thumbnail. If not, then load it at
jsQuarter or jsHalf.

You can find the resampling algorithm in the GraphicEx library of Mike
Lischke (search Google).

You can try ABC-View Manager's "webpage generator" to get an idea of the
speed. I think it is fast enough for most applications. And I don't even use
the half/quarter/eighth loading technique for generating these web
thumbnails.

Hope this helps.

Nils Haeck
Developer of ABC-View Manager (image management solution)
www.abc-view.com


Daniil <dan...@NYCfoto.com> wrote in message news:3cd2db46$1_1@dnews...

Flavius Vespasianus

unread,
May 3, 2002, 9:36:20 PM5/3/02
to
"Daniil" <dan...@NYCfoto.com> wrote in news:3ccf2b1f$1_2@dnews:

> Hi,
>
> I'm writing a program to show grid of images as a preview. Since I'm
> working with huge size images (JPEGs only) resize takes long time.
> Resently I found out there is a way to extract a thumbnail from JPEG
> file itself so no resize is needed.
>
> Does anyone know how to do that!?

The JFIF JPEG file format (the one everyone uses) defines a mechanism
storing a thumbnail image in the JPEG stream. You can look at the JFIF
standard (Search for JFIF) and you can see how this is done.

HOWEVER....thumbnails are rarely stored within JFIF files.

Nils

unread,
May 5, 2002, 5:29:47 PM5/5/02
to
Perhaps rarely for images from internet and editors, but most digital
cameras do use this option! So I guess that's the trend for the future,
since digital photography is booming.

Nils
www.abc-view.com

Flavius Vespasianus <n...@nl.com> wrote in message news:3cd33b14_1@dnews...

David J Taylor

unread,
May 5, 2002, 5:34:35 PM5/5/02
to
Please note that I said it comes with a Delphi demo. I did _not_ say that
it compiled! Quite deliberately! I can sebd you the IPL.pas that I use
(which _does_ work!).

Cheers,
David

"Daniil" <dan...@NYCfoto.com> wrote in message news:3cd2ff40$1_1@dnews...

Daniil

unread,
May 6, 2002, 10:17:43 AM5/6/02
to
Could you? I still don't understand intel could put something not working
online. and since i'm relative novice in delphi, i can't understand how to
fix it.

thanks :)

"David J Taylor" <david...@writeme.com> wrote in message

news:3cd5a56a$1_2@dnews...

Richard Post

unread,
May 15, 2002, 7:24:36 PM5/15/02
to
Maybe someone can post the first message (and answer) because it is already
deleted from the server and my problem is that I want to know how to resize
/ extract thumbnail from a jpeg file.

"Daniil" <dan...@NYCfoto.com> wrote in message news:3cd182ca$1_1@dnews...

Daniil

unread,
May 16, 2002, 7:55:56 PM5/16/02
to
I was suggested to set scale property in jpeg image before reading image. it
won't extract thumbnail but it will load jpeg at smaller size. after that u
can SketchDraw to another picture.


"Richard Post" <ric...@quicksoft.tk> wrote in message
news:3ce2ee35_1@dnews...

0 new messages