pixi icon indicating copy to clipboard operation
pixi copied to clipboard

[Feature] Export selected sprite(s) to `png` or `jpg`

Open foxnne opened this issue 3 months ago • 8 comments

The goal would be to add a new hotkey, as well as a new in-app DVUI modal dialog to choose options for the export. To see what existed before, check out the mach branch (builds with latest mach nominated version of zig) and select sprites and press ctrl/cmd + p.

For now, since animations are not currently in pixi, this dialog should just offer options to export the selected sprites either as a single image (combined) or as individual images per sprite. It should also offer the ability to choose an export scale, as exporting for posting online would mean we would need to offer something like 1-32x scale in a slider for the export. Maybe we cap the max export size at a reasonable size? 4092x4092 or something?

I tried to think through the steps I would take to implement this new feature, hopefully this is helpful:

  • Add a new keybind, which would be ctrl/cmd + p and added here.
  • Process the new keybind from FileWidget, here and call function below.
  • Add a new function, I suppose print to Editor, which is kind of a mess of functions right now, but general functions that operate on the active file tend to end up there. Maybe here?
  • Check out copy in Editor, it grabs each sprite, and copies them into the "transform" layer, which is just essentially writing them into a blank texture/dvui image source, and then crops them down to just the non-transparent pixels. For exporting them with the hotkey, we would essentially just skip the cropping.
  • Then we need to offer a dialog to choose the export type and location. As of the latest DVUI, we can now offer exporting png and jpg, so I'd love to support both. This would mean creating a new dialog box gui in pixi, which then opens a native file dialog through DVUI.
  • If possible, the dialog box would let you choose file type through a dropdown, and also export scale, since we would like to export pixel art at sometimes up to 16-32x scale for posting or whatever

foxnne avatar Sep 15 '25 12:09 foxnne

Just letting you know im still working on this but havent had much time this week. Put it a bit of overtime for a project at work. Will work on it more this weekend. 😵‍💫

Dlewis89 avatar Sep 19 '25 23:09 Dlewis89

haha no rush!

foxnne avatar Sep 20 '25 13:09 foxnne

Hey,

so i have good and bad news. Good news my boss want to start transitioning some of our workload and tools we build to more AI based stuff. Bad news i will be neck deep in learning AI stuff for the next couple to a few months so i wont have time to help on the project. 😰

Dlewis89 avatar Oct 01 '25 18:10 Dlewis89

so i have good and bad news. Good news my boss want to start transitioning some of our workload and tools we build to more AI based stuff. Bad news i will be neck deep in learning AI stuff for the next couple to a few months so i wont have time to help on the project. 😰

Its alright! This project will be here in the future if you'd like to pick it up, and if not thats fine too :) I appreciate your interest and I hope your work goes well!

foxnne avatar Oct 02 '25 14:10 foxnne

Really appreciate and i will be back. You have a highly interesting project and i still have a high interest in learning zig. Just right now im taking on something i know really nothing about so diving in hard. 😂

Dlewis89 avatar Oct 03 '25 00:10 Dlewis89

Hey boss, hope all is well. So I might be able to come back to this. We had a tons of changes at work the past week or so and i'm under a new manager now that has different priority then implementing AI solutions so I think i am in the clear but I should know for a fact by the end of next week what direction we are going.

Dlewis89 avatar Oct 20 '25 23:10 Dlewis89

Hey! Nice! Hopefully being under a new manager is a good move for you, and no rush on this of course!

foxnne avatar Oct 21 '25 16:10 foxnne

Being under a new manager is a double edge sword. There is good and bad about it. Just have to keep up with the flow at this point.

Only weird thing right now is my new manager treats me more like a software engineer than a data analyst. This week I built a python desktop application that reads text from another internal program we run because we don't have access to the api and then it send out a slack message via the slack webhook api to the managers channels if metrics fall to low.

Don't get me wrong I love the idea of working on a variety of projects but it's very different from working in excel and using python to read csv file and create charts and graphs. lol

Was fun and very encouraging to see that i could actually do it tho. 😄

I'll put it up in the github at some point, just have to go back through it and make sure that it doesn't expose any company sensitive information and optimize it a bit more.

How has work been for you?

Dlewis89 avatar Oct 24 '25 00:10 Dlewis89