joyhughes / Jen

Image processing, generative photography, cellular automata
https://discord.gg/GQQHUbkf
21 stars 20 forks source link

Save current image #79

Open joyhughes opened 2 months ago

joyhughes commented 2 months ago

Allow user to save the current contents of ImagePort to disc (or photos on mobile).

UI is possibly a button in the media controller.

aaradhyasinghgaur commented 2 months ago

Hey , @joyhughes
Participation Role :- Contributor / GSSOC-2024

I would like to work on this issue . Kindly assign this issue to me

joyhughes commented 2 months ago

Hey , @joyhughes Participation Role :- Contributor / GSSOC-2024

I would like to work on this issue . Kindly assign this issue to me

@kyra-09 I have assigned you the issue. Look at the file ImagePortCanvas.js - I get the pixels with the following:

    const imageDataArray = window.Module.get_img_data();
    const bufWidth  = window.Module.get_buf_width();
    const bufHeight = window.Module.get_buf_height();

and then

    const imageData = new ImageData(
      new Uint8ClampedArray(imageDataArray.buffer, imageDataArray.byteOffset, imageDataArray.byteLength),
      bufWidth,
      bufHeight
    );

and const imageBitmap = await createImageBitmap(imageData); This is the data to save.

joyhughes commented 2 months ago

Add a download button into MediaController.js

aaradhyasinghgaur commented 2 months ago

Thanks @joyhughes for assigning me this...I will get back to you with more updates and info and doubts if I'll have any

joyhughes commented 2 months ago

View the Lux Vitae video here: https://www.youtube.com/watch?v=vN1ApdESIrc @kyra-09

joyhughes commented 1 month ago

@kyra-09 Please join Lux Vitae discord https://discord.gg/GQQHUbkf

joyhughes commented 1 month ago

@kyra-09 Is there anything I can do to help you proceed?

aaradhyasinghgaur commented 1 month ago

hey @joyhughes the repo doesn't have package.json file ?