Seems like blurring on demand could be OK. I've been messing around with it (see attachment)
edit: the artifacting is my gif recorder, not my blurring.
Yes, looks quite the same as my implementation. Your memory usage doesn't increase at all.
I changed my code to dispose of the blurred image after displaying it and now my memory usage does not increase at all anymore.
this.paint = function (gr) {
var offset_px = this.offset * this.properties.px.value;
// Added
if ( this.images.length > 0 ) {
if ( transparent == 1 ) {
gr.FillRectangle(0, 0, panel.w, panel.h, colours.background); // paint full background to remove PSS background art
}
if ( blur == 2 ) {
this.blur_img = this.images[this.image].Clone();
this.blur_img.StackBlur(120);
}
if ( blur > 0 ) {
_drawImage(gr, thumbs.blur_img, 0, 0, panel.w, panel.h, image.crop, 0.7);
// gr.DrawImage(thumbs.blur_img, 0, 0, panel.w, panel.h, 0, 0, this.blur_img.Width, this.blur_img.Height, 0.7, 0);
// DrawImage(thumbs.blur_img, dstX, dstY, dstW, dstH, srcX, srcY, srcW, srcH[, opacity, angle])
if ( blur == 2 ) {
this.blur_img.Dispose();
this.blur_img = null;
}
}
}
...
Great stuff these adjustments.