Topic: Looking for a project?

If someone's looking for a project to do, here's something we'd like to see written.

One thing that's holding us up on supporting local and LAN photos is that with some of the newer large-format cameras, the images are too large to render.  For instance, a single 12M pixel image would take as much as 48MB of memory to build an image that can be subsequently scaled and rendered.

What we need is a simple command-line tool that will read, scale and output an image inline - reading just enough of the source image at any time to output scanlines.  It be small, should use as little memory as possible, and be fast.

Ideally, this tool would take the most common images generated by cameras - JPEG, TIFF - and output JPEG.  By default, the output image size would be 320x240, and it should take both input and output filenames with the option of using stdin and stdout.  It should also have an option for filtered scaling, and JPEG output quality.

The license would have to be "GPL2 or later".

Something like:

imgscale (options)
 -i <input file name, stdin by default>
 -o <output file name, stdout by default>
 -x <max output width, 320 by default>
 -y <max output height, 240 by default>
 -p preserve aspect ratio of input
 -q <output quality, 0-100>
 -f <filter quality 0=nearest neighbor, 1=bilinear, 2=bicubic>
 -h help

2 (edited by GoodDoctor 2008-02-13 22:50:49)

Re: Looking for a project?

in my 5th week of Visual Basic .Net........ I can cheer from the sidelines!

Would this work?

https://sourceforge.net/projects/jmjrst/

Re: Looking for a project?

how about imagemagick  (http://www.imagemagick.org/script/index.php) ?  as-is or use it as a model to make a simplified version

Re: Looking for a project?

It seems you are mostly looking for a DDA (Digital Differential Analyzer).  Similar source code is around and online.  It is a very memory-efficient and fast way of doing scaling.  To give you an idea of how fast a DDA is, we used to use them on 10 mhz 80286 machines back in the 1980s to scale image data.

Use the google 'code' site and search for dda.c!  If you can't find a match let me know... I still have the C code lying around.

Re: Looking for a project?

tpfaff100 wrote:

It seems you are mostly looking for a DDA (Digital Differential Analyzer).  Similar source code is around and online.  It is a very memory-efficient and fast way of doing scaling.  To give you an idea of how fast a DDA is, we used to use them on 10 mhz 80286 machines back in the 1980s to scale image data.

I don' t think scaling in a memory efficient way is the hard part, I would suspect decompressing the large compressed images into scan lines within the memory limitations of the Chumby would be the challenging part.  I'm not familiar enough with the JPEG or TIFF format to tackle it.  Although I would suspect an uncompressed TIFF format wouldn't be too difficult.

Re: Looking for a project?

Yeah, the point here is that we don't have enough memory to read the entire source image at these resolutions.  We need to read just enough scanlines to scale and produce an output scanline.

Most image scalers I've seen read the entire source image, scale it, then write out the scaled image - which means you need enough memory for both uncompressed images.  That's not what we're looking for here.

This isn't a particularly *hard* project - we're simply resource limited to do it ourselves at the moment.

Re: Looking for a project?

How much memory does ImageMagick take whilst resizing? Has it been tried?

http://www.imagemagick.org/script/comma … php#resize