Image manipulation (not display object)

So here’s the thing. I used to make some hobby projects - 2d games in previous years using Corona and for that it was perfect.

Now I want to use Solar2D for an app, a “shell” let’s say. The main work will be done on the server.
What I already managed to achieve:
Selecting a photo from library, sending it with POST request to my API, getting the post-processed image as response and displaying it.
What I need to do, and for know I don’t know how, is to resize the actual input photo so it’ll be lower than let’s say 2000 pixels (preserving the aspect ratio). I tried changing width and height of the display object and then saving it with this code:
local path = system.pathForFile( "input_image_resized", system.TemporaryDirectory ) local file = io.open( path, "w+b" ) file:write( input_image ) io.close( file )
But it didn’t change the actual image dimensions, same sized image is sent with POST request.

What approach should I take to achieve that? Are there native lua functions to do that? Should I create a plugin for that (no idea how to start)?

Second thing I want to achieve at the end is to merge two images (tranparent PNG on top of the second - background) and save it to gallery. Can that be easly done or should I rather look for another framework than solar2d?

Hi.

I’d wrapped some resize operations in my impack plugin. I believe I use that or a filter in the sample, too, linked on the “Index” page.

The data gets passed around as a string (RGBA values, 0-255), so you could just manually do the layering process. (At one point I remember thinking about adding some capability like this, but never bit the bullet.) There’s another plugin that complements this called Bytemap that might help as far as inserting the bytes in the right region (again, see its sample).

Thanks for tips.
I guess using Solar2d in my case is not a good option. I switched to a no-code solution for now (Thunkable) with quite good results. I think I’ll have a working MVP in 3 days.