Hacker News new | ask | show | jobs
AWS Lambda Golang: Image manipulation on lambda using Golang
2 points by pkrawat1 2453 days ago
Hi there, fellow golang folks.

I’m working on a project that requires some image transformation on the fly using aws lambda with s3.

Till now I was only able to find some good blogs on writing golang code to do image conversion and transformations, yet I could not find any dedicated golang library that can be deployed straight to AWS lambda with some config. Of which I got up with a thought of creating one myself for the community.

The focus of the library would be to give maximum possible implementation that a dedicated CDN like cloudinary does. Yet CDN thing will be the next milestone.

So just wanted to know before jumping into this. If this thing is really a requirement at all.

2 comments

This sounds interesting. I think trying to do something like cloudinary would be difficult since they are also using multiple replications across regions which won't be possible in your case as you will be storing the images in s3 and buckets will be region-specific what do you think about that?

Also, I would suggest don't keep it platform(Lambda) specific. With the rise of other platforms like Azure and GCP devs would want to deploy this on other platforms as well. Thoughts?

cloudinary level is too far at the moment.Also cdn handling will happen at later stage, where we can generate a copy of the image transformation on all the required regions. And on request to lambda, we can check for the requested region, and reply with correct region image url. Something like that may be. But that's not a requirement as of now. Currently I'm considering to region specific implementation only. something like an ecommerce website that runs and scopes to a specific region only.
Do image processing in the browser you would utilize the browser's and the user's resources not having to do backend processing, that's what photoshop does and what most of the image processors do, it's what you should be focusing on.
This is not just image processing. Its also image size reduction using mordern formats like webp on the fly. So If the front end asks for a image which is stored as 1024x768 on s3 with a new size as 800x600 then the lambda service should convert the image to 800x600, reduce the image quality and send to frontend there by reducing the image file size. I have done this using backend code for ecommerce app. Where the product listing image sizes where reduced to like 30-50KB from 150KB. making the list images load pretty fast.