Re: Challange

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tue, 29 Dec 1998, Albert Brauneis wrote:

> I have a challenge for you all, well it isn't really a challenge but I would
> like to see it done. I want to see a program that will take a picture and make
> a thumbnail of it and the size of the file has to be very small. I want it to
> do this in bulk, like it will allow you to pick 25 files and it will go and
> make thumbnails of all of them and name them something different. IF you don't
> know what I mean just ask.

Someone out here (Jaques D. or Jiri B.??) made an image expansion tool a
while ago. They might be able to help. Also, look up "wavelets" on the
'net.

Here's a simple English-style algorithm for shrinking an image to a
quarter of the original size:

Store the image in memory. Call it A.
Create a sequence for the thumbnail B.

for j = 1 to depth(A) by 2
    for i = 1 to width(A) by 2
        B[(i+1)/2][(j+1)/2] =
            Averageofcoloursof(
                A[i]  [j]
                A[i+1][j]
                A[i]  [j+1]
                A[i+1][j+1]
            )
            -- Rather than averaging here, you could do any number of
            -- things. The simplest being taking just A[i][j].
    end for
end for

Recalibrate palette and colours.

There are obvious flaws in this code (I don't handle the bitmap seq.s
properly for a start), but I hope the idea is clear enough.

Ha Pinoo-yaer,
Carl

--
Carl R White -- Final Year Computer Science at the University of Bradford
E-mail...: cyrek- at -bigfoot.com -- Remove the hyphens before mailing. Ta :)
URL......: http://www.bigfoot.com/~cyrek/
Ykk rnyllaqur rgiokc cea nyemdok ymc giququezka caysgr -- B.Q.Vgesa

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu