开发者

Low memory consumption watermarking for Python

I'm trying to add an image watermark to images (image sizes can go up to 2.5MB), but my current solutions require a larger amount of memory - at the moment I'm using https://bitbucket.org/codekoala/django-watermark.

Because of the 60MB memory limit define by my hosting, I'm getting MemoryError errors.

It could be a memory leak or 2.5MB images a开发者_运维百科re just too big for 60MB ram limit. Before I do anymore investigations, does anybody know for a low memory consumption image watermarker? Current one uses PIL (afaik is the best for the job). As I recall, it offers an option to load image by parts - it could be my solution but I don't find any resources regarding it.

Best regards, E


Python offers little ready / productized tools for progressive image processing. My recommendation way is simply to move a hosting where you can safely decompress a full image to the memory. This does not go for Python, but for other platforms as well generally.

The only thing which can be buffered with PIL is loading the image over the network connection, so that you can start processing the image before it has been fully received.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜