Cursor Exporter
I made a script to export icons and cursors (of course animated ones too).
It supports following file types: .ico
, .cur
, .ani
.
Would be great to get feedback!
(BTW I also made a type definition of whole Aseprite API this time…: https://github.com/Tsukina-7mochi/aseprite-type-definition; I made another topic for it)
5 Likes
Hi @Tsukina-7mochi,
The Aseprite API type definition is very, very helpful. Thank you for making it! I had no idea that could be done. Would you please create a separate post linking to it so that it is easier to search for on this forum?
Cheers,
Jeremy
@behreandtjeremy ok I’ll make a separate post
I made another topic for that script, but the topic (and this) treated as spam… probably I was a new user at that time.
https://community.aseprite.org/t/type-definition-for-aseprite-api/16288
1 Like
Sorry to necro this, but I’m having an issue. I downloaded the script and put it to use, nd while it absolutely created a functional .cur file that I could use… for some reason, only the white outline is visible, and all color is rendered transparent. I’ve flattened the layers, removed transparency, selected specific layers, all for naught as it still gives the same issues. Any help, or possibly an update for the script that fixes this odd issue?
Thanks to reporting the issue, but I’ve not encountered the same problem. If you could send me the aseprite file I’ll investigate to fix the script.
Hi, thanks a lot for making this! I tried using it but I keep getting this error:
Export as ico cur ani.lua:522: attempt to index a function value (field ‘setPalette’)
Thanks Fateburn contacted me on twitter, that was bug and now fixed.
Hi! I just downloaded the script and put it to use to export a gif to an ani file, it worked! but for some reason the ani file gets a strange blurry outline like if the colors are melted and I cant get to fix the issue
Exporting to icos, curs and anis is complicated. So bug reports need details to stand a chance of anyone figuring out the issue.
A strange blurry outline could be a result of the image not being a uniform power of 2 in size (16x16, 32x32… ). A nonuniform power of 2, like 256x128, could still cause issues if the ani were upscaled using a bilinear filter. Any bigger than 256x256 and there are no guarantees.
With anis, there’s an extra wrinkle. Suppose that at frame 1, a cur listed within an ani has a width and height different from the cur at frame 2. I’ve not tested what happens with this, but the least error-prone scenario is when the ani and all the curs inside it have the same size.
icos (and by extension curs and anis) contain two sets of transparency data. At least, when they embed bmp-like image data, they do. One set might be included within the RGB32 or RGBA32 color data – there’s no way to tell the difference between the two formats on import. The other set is written as a binary mask – either opaque or transparent.
A strange blurry outline could also be a result of that second binary data
- conflicting with the color data (e.g., transparent colors having non-zero RGB channels);
- not being written with the correct padding per row;
- or being set to a default value when it shouldn’t be.
The ico header could also have incorrect header data that tells an importer where to find the palette data (if any), color data and the binary mask data in the file.
I’ve seen Windows 11 load icos, curs and anis just fine while other image software (Irfanview, XnViewMP, GIMP) had problems. So it depends on where you’re opening and looking at the ani as well.
For more edge-of-your-seat reading:
@behreandtjeremy Thanks for sharing the generic solution to the problem!
@Shad_Ensk Can you share an example file that can reproduce the problem if the problem still exists? Even if the problem is due to the sprite you are trying to export, I can add a warning for the data.