CLI: export Sprite with a specific palette #1245

Closed
Nodragem opened this Issue Sep 4, 2016 · 6 comments

Comments

Projects
None yet
2 participants

Nodragem commented Sep 4, 2016

I made a character animation with color indexing and I use different palettes to get different types of character (e.g., purple, green, yellow).

I would have thought that the command --palette <filename> could be used to export my character animation with the color palette that I want, but it seems not to do so...

It is actually possible to do what I am speaking of for now?

Owner

dacap commented Sep 4, 2016

Hi @Nodragem, the --palette is an old parameter used to change the default palette of the program (almost useless nowadays). You are the second user that found the same problem so I'll change the meaning of --palette parameter so we can change the palette and save the sprite with different palettes (it makes a lot more sense).

Anyway, there is a quite "hidden" feature that I made some time ago for that other user. You might try to use the script inside the attached .zip (save-with-other-palette-test.zip) and execute Aseprite in this way:

./aseprite -b --script test.js 

See the content of the test.js file. You will see that it's straight forward to change it for your needs. I hope you find it useful for your specific case.

dacap added the enhancement label Sep 4, 2016

dacap added this to the v1.1 milestone Sep 4, 2016

dacap self-assigned this Sep 4, 2016

@dacap dacap modified the milestone: v1.2, v1.1 Sep 5, 2016

Owner

dacap commented Sep 5, 2016

This will be available in v1.2-beta2. An example for the future usage syntax:

aseprite -b test.bmp --palette pal2.bmp --save-as test2.bmp

dacap closed this Sep 5, 2016

Nodragem commented Sep 5, 2016

Thank you!

Concerning the hidden feature. Are you telling me that we can simulate an Aseprite session with a javascript file? that sounds really powerful!
I did not see the --script command in the doc, I think that it should be an official feature :)

Owner

dacap commented Sep 5, 2016

You're welcome! The --script is a little hidden because there is no official API yet, as you said, it can simulate just a few commands (also it's quite easy to crash Aseprite using the API incorrectly). There is some features with more priority at this moment like #126 and #475 which I think would be better for most users.

Nodragem commented Sep 5, 2016

isn't #475 requiring the API we just spoke about?

Owner

dacap commented Sep 5, 2016

More or less. Actions could be recorded in an XML file to execute UI commands, which then are easier to be modified/edited (so then you can edit your macro/actions step by step). Instead the API is a more text-based/scripting like set of functions that might be bigger than the available UI commands, also it could be then impossible to edit the script step by step from the UI (because that would be like refactoring the JavaScript code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment