I take it the image manipulation is different every time, so you can't cache the resulting scaled/manipulated image?
Yes, the number of possible combinations is so high that creating cached copies of each possible image would require too much space and processing time.

What kind of transformations are you doing? It's probably possible to "stream" the JPEG decoding and processing through a pipeline in one pass, as opposed to reading the whole thing and consuming 12 meg of ram, then performing different passes for each part of the process, then encoding the result.
ImageMagick currently processes the following transformations: crop, scale, extract channel, composite image, clone, and add decorative frames. I like the idea of computing these transformations as the JPEG is processed. Logically, I think that the transformations don't need a full image to be computed. However, because sometimes five or more of these transformations are computed in a row, and sometimes ImageMagick splits one image into two separate images and then computes transformations, they will need to be loaded into RAM at some point. I sense that your idea of streaming would speed things up quite a bit. I will look futher into this idea - does anyone have any input on this one?

Thanks for your ideas.

In reply to Re: Re: ImageMagick too slow by lpoht
in thread ImageMagick too slow by lpoht

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.