Any idea about how to deal with large image?

266 views
Skip to first unread message

Jiahua Chen

unread,
Jul 5, 2014, 1:31:42 AM7/5/14
to golan...@googlegroups.com
In my cause, my image format is PNG and size around 170MB. For now I just use `image.Decode` for the full image, but it takes huge huge huge memory on my Mac. So, is there any way in Go to deal the image part by part? Then reduce the memory usage.

Thanks!

Justin Israel

unread,
Jul 5, 2014, 2:19:27 AM7/5/14
to Jiahua Chen, golang-nuts
I'll leave it to others to respond with references to the stdlib and/or other external libs, but I thought I might mention my library since it could potentially be relevant. I've been working on bindings for OpenImageIO, which includes an ImageCache that handles transparently loading tons of images, managing how many files are actually open at any given time, and serving scanlines/tiles on demand. 

I can't say I am any kind of authority on OpenImageIO yet, as my primary purpose for creating the bindings was to have support for common file formats to Visual Effects like EXR, as well as integrated support with OpenColorIO for studio color pipelines. But the oiio library does offer quite a lot of support for efficient reading/writing in terms of scanline/tile/subimage of large/many images.


Document ref (and possibly section "7 Cached Images" to be specific): 

OpenImageIGO bindings:

Still working on completing them, but I have a good majority of it done so far.

-- justin




On Sat, Jul 5, 2014 at 5:31 PM, Jiahua Chen <joe20...@gmail.com> wrote:
In my cause, my image format is PNG and size around 170MB. For now I just use `image.Decode` for the full image, but it takes huge huge huge memory on my Mac. So, is there any way in Go to deal the image part by part? Then reduce the memory usage.

Thanks!

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages