dreamsambit Posted September 1, 2016 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 5 Reputation: 0 Joined: 07/28/15 Last Seen: October 21, 2024 Share Posted September 1, 2016 I use this script Layer layer = act[selectedActionIndex, selectedFrameIndex, 0]; GrfImage image = layer.GetImage(act.Sprite); image.Convert(GrfImageType.Indexed8); script can convert image to Indexed8 it can run ,but when I want to save , will get a error -------------- Exception -------------- System.IndexOutOfRangeException: GRF.FileFormats.SprFormat.SprAbstract._writeAsBgra32(BinaryWriter writer, GrfImage image) GRF.FileFormats.SprFormat.SprAbstract._saveAs(Spr spr, String filename, Byte major, Byte minor) GRF.FileFormats.SprFormat.SprConverterV2M1.Save(Spr spr, String filename) GRF.FileFormats.SprFormat.Spr.Save(String path) GRF.FileFormats.ActFormat.Act.SaveWithSprite(String actPath, String sprPath) ActEditor.Core.ActEditorWindow.SaveAs() ------------------------------------------------------- I don't know how to change "writeAsBgra32" to "writeAsIndexed8". have any one can teach me how to convert image in sprite correct ><" thanks a lot. Quote Link to comment Share on other sites More sharing options...
0 Tokei Posted September 2, 2016 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 699 Reputation: 738 Joined: 11/12/12 Last Seen: Saturday at 09:01 PM Share Posted September 2, 2016 (edited) You can simply right-click the image and convert it: I'm not sure what you're trying to do here. Edit: The script up there will break the SPR format. I should really remake that tool's interface, was a bit messy at the time. Edited September 2, 2016 by Tokei Quote Link to comment Share on other sites More sharing options...
1 Tokei Posted September 2, 2016 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 699 Reputation: 738 Joined: 11/12/12 Last Seen: Saturday at 09:01 PM Share Posted September 2, 2016 Bgra32 images take a lot more space than indexed8 images. Indexed8 images are RLE compressed while bgra32 images are just raw data. Either way, putting them in a GRF will compress your files so there's no real need to worry too much about that. Quote Link to comment Share on other sites More sharing options...
0 dreamsambit Posted September 2, 2016 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 5 Reputation: 0 Joined: 07/28/15 Last Seen: October 21, 2024 Author Share Posted September 2, 2016 You can simply right-click the image and convert it: I'm not sure what you're trying to do here. Edit: The script up there will break the SPR format. I should really remake that tool's interface, was a bit messy at the time. I have some .spr and i want to reduce they file size original size is 392KB ,and after convert will become around 70KB but have more then 300+ files and about 40 image in each spr file..... Quote Link to comment Share on other sites More sharing options...
0 dreamsambit Posted September 4, 2016 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 5 Reputation: 0 Joined: 07/28/15 Last Seen: October 21, 2024 Author Share Posted September 4, 2016 Bgra32 images take a lot more space than indexed8 images. Indexed8 images are RLE compressed while bgra32 images are just raw data. Either way, putting them in a GRF will compress your files so there's no real need to worry too much about that. Thank you for your comment. BTW,I find a way to convert Indexed8. just use PhotoShop convert image into indexed format ,and then add that into sprite,merge palette. Quote Link to comment Share on other sites More sharing options...
Question
dreamsambit
I use this script
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.