• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Post reply

Other options

Shortcuts: ALT+S save/post or ALT+P preview

Topic summary

Posted by Galfar
 - 10 October 2009, 12:56:55
Great, let me know when you get some results.
Posted by cabbott
 -  8 October 2009, 15:37:51
Thanks for responding.

By Bitmap I mean 24-bit decoded image (R8G8B8).

Yes, I started looking at JpegLib with a view to tweaking it.

This will certainly save me a huge memory and time overhead rending from JPEG to R8G8B8, then rescaling back to 32x32 R8G8B8. Why mess about with a 30MB image when a 3KB one will do!

If I get anywhere I will let you know, you could include it in a future build - I can't be the only one that wants to avoid wasted CPU time and memory!
Posted by Galfar
 -  8 October 2009, 15:22:32
Sorry for late reply, GMail started to throw notifications from this forum to spam bin for some reason  >:(

When you mention "Bitmap", you don't mean converting to TBitmap right?

There's currently no direct way of doing what you want, you'd have to
modify ImagingJpeg.pas unit:
1) JpegLib used by Imaging to load Jpegs is able to return scaled images (but I think it only scales with retaining the original aspect ratio).
2) Currently JpegLib is set up to send full scanlines one by one to Imaging. You could modify it to drop some scanlines and resize the ones you want to 32 pixels wide.
Posted by cabbott
 -  5 October 2009, 13:10:56
I am running a threaded app that is loading JPG images and then rescaling them to 32x32.

Obviously this is resulting in each image being loaded, rendered to a Bitmap at full size, then resized back to 32x32.  All of which inhales memory like it's going out of fashion because I am running 8 threads!

Is there any way of loading a JPG image and rendering it directly to a specified size, thus avoiding the huge memory overhead rendering a full size Bitmap first?

I am using other image types as well, but lets concentrate on JPG to start with!

PS. Thanks for a very comprehensive imaging library.
SMF spam blocked by CleanTalk