dreamsambit Posted September 1, 2016 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
0 Tokei Posted September 2, 2016 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
1 Tokei Posted September 2, 2016 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
0 dreamsambit Posted September 2, 2016 Author 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
0 dreamsambit Posted September 4, 2016 Author 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
Question
dreamsambit
I use this script
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.