Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Unicorn wrote:
Ok, so can you link to the release I should use? Not sure which one...

It's in the toolchain, in the /bin folder Wink

https://github.com/CE-Programming/toolchain/releases
Zaalane wrote:
Have you thought about adding a feature that splits larger pictures into indivisual tiles? Sort of like the PicConvert -t option. Also, I think having an option for making custom fonts would also be helpful. Smile

I added support for tilesheet conversions in this release: Smile

https://github.com/MateoConLechuga/ConvPNG/releases/tag/v4.0

I don't plan on adding custom font creation; there's already a ton of programs out there that do that Smile
I created a sprite using convpng for my train project. And then I deleted some of the rows of 0x##
because I didn't need them. I also changed the array number, changed the height number, and the array number in the header file. Before I did that, the program compiled correctly. Now I get this error message:

Error (183) Array "train_data" has too many initializers

If I go into the Qt editor, the "};" at the end of the array is underlined and says "expected a declaration". What did I do wrong?
Why.... would you do any of that rather than modify the original image. That... makes absolutely no sense Smile This isnt an issue with ConvPNG, it's an issue with your coding style and setup.
I tried downloading convPNG, but when I try to run it, it just gives me this.

Code:
[error] could not find file 'convpng.ini'.
Please make sure you have created the configuration file


How do I fix it?
calcnerd_CEP_D wrote:
I tried downloading convPNG, but when I try to run it, it just gives me this.

Code:
[error] could not find file 'convpng.ini'.
Please make sure you have created the configuration file


How do I fix it?

You can find everything you need in the graphics examples of the toolchain Smile

Well, even though ConvPNG is a part of the toolchain now, just thought I would let people know it was updated here in case it is used for asm development. (Probably no one but me Razz)
ConvPNG has gotten another update, this time a pretty nice one, and it has been placed in the C SDK Toolchain as well, so be sure to download it whenever you get a chance. Sorry for all the updates Razz

You can now use images to define a global palette that you can then use across all groups. This means if you have one group that is compressed and another that is not, they can both use the same palette.

In addition, there is now the keyword #OutputPaletteImage used to output a linear image of the palette. This is quite useful for determining which colors fill which indexes.

Also, the #NoPaletteArray keyword was also added, this basically just prevents the array from being added to the source by default. This is especially useful when working with global palettes.

You can find more information here: https://github.com/MateoConLechuga/ConvPNG/releases/latest

Don't forget about the toolchain Smile
https://github.com/CE-Programming/toolchain/releases/latest
So for my train program, I have two images that aren't compressed and one image that I need to be compressed. So would this work:

Code:

#GroupC            : train_gfx
#TranspColor       : 255, 255, 255, 255
#Palette           : xlibc
#Sprites           :
train.png
train_rail.png

#Compression        : lz77
#Sprites           :
map.png

Or do I have to specify a whole new group?
I think you would have to declare the compressed sprites as another sprite group. Just a question, though, why don't you just compress all of the sprites?
If you use lz77 compression, be advised that you will have to supply your own lz77 decompression code in order to use the sprites. (Fortunately, LZ77 decompression is a very simple algorithm.)
oldmud0 wrote:
If you use lz77 compression, be advised that you will have to supply your own lz77 decompression code in order to use the sprites. (Fortunately, LZ77 decompression is a very simple algorithm.)

The C graphics library supplies one already for you.
Wasn't aware of that. Might have a tiny hit on performance.
Compression has now been fixed to help ZDS parse the array. It also sends out a little warning if it doesn't make sense to compress an image. Smile

https://github.com/MateoConLechuga/ConvPNG/releases/latest
I added an option to ConvPNG in order to output in the ICE format. Here's how to use it; just post any bug if you have problems Smile I'm actually not sure if everything works correctly in this release as I updated a ton of things; but I plan to test it a lot before adding it to the C toolchain.

1) Download the 5.4 ConvPNG prerelease from here

2) Create a file called "convpng.ini" (Without the quotes, also mind the extension)

3) Copy and paste these lines into convpng.ini:


Code:
#GroupICE            : ice_gfx
#Palette             : xlibc
#PNGImages           :


Now, below the #PNGImages line you can simply add the names of the png files you wish to convert, as long as the png files are in the same directory as convpng. For example, if I have 3 pngs named xxxx, yyyy, and zzzz, this is what my convpng.ini file would look like:


Code:
#GroupICE            : ice_gfx
#Palette             : xlibc
#PNGImages           :
 xxxx
 yyyy
 zzzz


To run convpng, simply double click on the convpng.exe file. Output will be written to ice_gfx.txt

Enjoy Smile

Code:
Anthonys-MBP:src acagliano$ ./convpng -i /Users/acagliano/Desktop/ConvPNG-3.0/test/convpng.ini
ConvPNG 2.0 by M.Waltz

Opened /Users/acagliano/Desktop/ConvPNG-3.0/test/convpng.ini
convpng(66527,0x7fffa01543c0) malloc: *** error for object 0x3: pointer being realloc'd was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6


Attempting to convert an RBG image into a 16bpps image for use on the calculator. Getting the following input. What am I doing wrong?
ACagliano wrote:

Code:
Anthonys-MBP:src acagliano$ ./convpng -i /Users/acagliano/Desktop/ConvPNG-3.0/test/convpng.ini
ConvPNG 2.0 by M.Waltz

Opened /Users/acagliano/Desktop/ConvPNG-3.0/test/convpng.ini
convpng(66527,0x7fffa01543c0) malloc: *** error for object 0x3: pointer being realloc'd was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6


Attempting to convert an RBG image into a 16bpps image for use on the calculator. Getting the following input. What am I doing wrong?


"Attempting to convert an RBG image into a 16bpps image for use on the calculator" is what you are doing wrong. Also what is with the whole -i thing. Just cd to the directory and run from there. Razz

EDIT: I think I may have fixed it; just keep in mind that you can't use paths yet. Thanks for the report Smile
Since new releases are coming out, it might be handy to have a link that always brings up the release that is the newest (v5.6 as of April 17).

https://github.com/MattWaltz/convpng/releases/latest
So I will just post my suggestions, seems like you forget it all the time Razz
It would be nice to ignore/remove some pixels/bytes in the output. This can help if you don't want a rectangular output (transparent or not), but you use your own routine to display the sprite. Either having a mask of some sort, or removing the transparent pixels in the output, or ... something else Wink
I've been having trouble using this. I've followed the instructions here as best I can but I'm obviously missing something.
Here is what my convpng.ini file looks like:

Code:
#GroupICE : ice_gfx
#PNGImages : C:\Users\TLM\Ti-84 Plus CE\Screenshots\YT sprites\Left bottom bar 2.png
#Compression : zx7
#Palette : xlibc
#OutputDirectory : C:\Users\TLM\Ti-84 Plus CE\Screenshots\YT sprites\bin


This is what it keeps returning in the output file:

Code:
Converted using ConvPNG
This file contains all the converted graphics

ice_gfx_pallete | 512 bytes
"0000008101020183020402850306038704080489050A058B060C068D070E078F08100891091209930A140A950B160B970C180C990D1A0D9B0E1C0E9D0F1E0F9F9000908191029183920492859306938794089489950A958B960C968D970E978F98109891991299939A149A959B169B979C189C999D1A9D9B9E1C9E9D9F1E9F9F202020A1212221A3222422A5232623A7242824A9252A25AB262C26AD272E27AF283028B1293229B32A342AB52B362BB72C382CB92D3A2DBB2E3C2EBD2F3E2FBFB020B0A1B122B1A3B224B2A5B326B3A7B428B4A9B52AB5ABB62CB6ADB72EB7AFB830B8B1B932B9B3BA34BAB5BB36BBB7BC38BCB9BD3ABDBBBE3CBEBDBF3EBFBF404040C1414241C3424442C5434643C7444844C9454A45CB464C46CD474E47CF485048D1495249D34A544AD54B564BD74C584CD94D5A4DDB4E5C4EDD4F5E4FDFD040D0C1D142D1C3D244D2C5D346D3C7D448D4C9D54AD5CBD64CD6CDD74ED7CFD850D8D1D952D9D3DA54DAD5DB56DBD7DC58DCD9DD5ADDDBDE5CDEDDDF5EDFDF606060E1616261E3626462E5636663E7646864E9656A65EB666C66ED676E67EF687068F1697269F36A746AF56B766BF76C786CF96D7A6DFB6E7C6EFD6F7E6FFFF060F0E1F162F1E3F264F2E5F366F3E7F468F4E9F56AF5EBF66CF6EDF76EF7EFF870F8F1F972F9F3FA74FAF5FB76FBF7FC78FCF9FD7AFDFBFE7CFEFDFF7EFFFF"


If it helps, the log file says:

Code:
Opened convpng.ini

--- Group ice_gfx (ICE) ---
Using built-in xlibc palette ...
0:

Converted in 0 s

Finished!


Go ahead and tell me what I'm blatantly missing. Very Happy
1) Don't put spaces in the png filename
2) Put all images on separate lines
3) ICE doesn't even support compression; so idk why you are trying to do that
4) Why are you even using the OutputDirectory command...
5) Basically everything is wrong Razz

Example
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement