So I have a line of code like this:
func TestImage(){
img, _ := imgio.Open(`input.jpg`)
inverted := effect.Invert(img)
f, _ := os.Create("output.jpg")
defer f.Close()
Encoder := imgio.JPEGEncoder(80)
Encoder(f, inverted)
}
All it does is just invert an image, which is simple enough. However, it can only do so to local file. So, say, if I have an image on site A that needs to be download, modify and upload back, I would have to
- Download the image to a local storage
- Load it
- Modify using that function
- Save it to the local storage
- Load it again to a POST function for uploading or something
I was wondering if there is anyway to achieve such task with out reading to save it and load it from a local storage? Like save the image as a "fake" file, which is a byte buffer or something.