fx-CP400 .c2p image format
10 posts
• Page 1 of 1
- critor
- Member
- Posts: 46
- Joined: Wed Jul 24, 2013 3:33 am
- Calculators: Casio fx-7400GII (SH4), Casio fx-9750GII (SH4), Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG50, Casio Classpad fx-CP400
fx-CP400 .c2p image format
I'm trying to understand the new fx-CP400 .c2p image format, in order to develop an image converter.
Direct analysis of some clipart .c2p files available on http://www.charliewatson.com/casio/cpends.php seems to already exclude trivial formats like BMP RGB, since the geometry of the large solid color areas is not visible at all in a hexadecimal editor.
So the image data is at least compressed.
Casio reinventing the wheel seems unlikely to me, and I would think of a derivative of a common picture format, or data compression format.
Here is a very simple screen capture made with ScreenReceiver (320x528 pixels) capture :

And now the .c2p file generated with the fx-CP400 StorePic instruction :

Eventually, we'll certainly have to understand the header and footer, but for now I'd like to focus on the data area - so basically from 0xB0 to 0x15F.
I've already found what seems to be the dimensions of the image, 4 bytes starting at 0xC2 :
- 0x136 ( 310 )
- 0x191 ( 401 )
It would be here 310x401 - probably the StorePic instruction is removing borders and menu bars.
An idea about the format assuming that Casio uses some usual image or data compression format ?
Thank you .
Direct analysis of some clipart .c2p files available on http://www.charliewatson.com/casio/cpends.php seems to already exclude trivial formats like BMP RGB, since the geometry of the large solid color areas is not visible at all in a hexadecimal editor.
So the image data is at least compressed.
Casio reinventing the wheel seems unlikely to me, and I would think of a derivative of a common picture format, or data compression format.
Here is a very simple screen capture made with ScreenReceiver (320x528 pixels) capture :

And now the .c2p file generated with the fx-CP400 StorePic instruction :

Eventually, we'll certainly have to understand the header and footer, but for now I'd like to focus on the data area - so basically from 0xB0 to 0x15F.
I've already found what seems to be the dimensions of the image, 4 bytes starting at 0xC2 :
- 0x136 ( 310 )
- 0x191 ( 401 )
It would be here 310x401 - probably the StorePic instruction is removing borders and menu bars.
An idea about the format assuming that Casio uses some usual image or data compression format ?
Thank you .
- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: fx-CP400 .c2p image format
Hi,
the format resembles the fx-CG G3P-Format. The G3P pictures are kind of zlib-compressed (as far as I remember developed by Mark Adler). There are fx-CG-syscalls, which do the inflate-/deflate-job, but I did not properly publish their interfaces. There have been certain concerns ([1] and [2]).
the format resembles the fx-CG G3P-Format. The G3P pictures are kind of zlib-compressed (as far as I remember developed by Mark Adler). There are fx-CG-syscalls, which do the inflate-/deflate-job, but I did not properly publish their interfaces. There have been certain concerns ([1] and [2]).
I'll be back!
- critor
- Member
- Posts: 46
- Joined: Wed Jul 24, 2013 3:33 am
- Calculators: Casio fx-7400GII (SH4), Casio fx-9750GII (SH4), Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG50, Casio Classpad fx-CP400
Re: fx-CP400 .c2p image format
Thank you very much for the hint, SimonLothar.
And would you have the zlib data offsets so that I can try to inflate it?
And would you have the zlib data offsets so that I can try to inflate it?
- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: fx-CP400 .c2p image format
First I want to cite correctly
"...version 1.2.3, July 18th, 2005
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler..."
This refers to the essential algorithms used with G3P-files.
I'd suspect the the start of the compressed image at 0x00DC in the C2P-hexdump you posted (0x00D0 with G3P). But I did not verify it, yet.
Hint: Possibly the original deflate-/inflate-algorithms have been "specialized" by the calculator's manufacturer.
"...version 1.2.3, July 18th, 2005
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler..."
This refers to the essential algorithms used with G3P-files.
I'd suspect the the start of the compressed image at 0x00DC in the C2P-hexdump you posted (0x00D0 with G3P). But I did not verify it, yet.
Hint: Possibly the original deflate-/inflate-algorithms have been "specialized" by the calculator's manufacturer.
I'll be back!
Re: fx-CP400 .c2p image format
The word at 0xDC (0xD0) is probably some kind of ID.
See: http://www.omnimaga.org/casio-prizm/hac ... halted%29/
It seems to encode the following information:
- type or version of the image format
- program or function used to create it
- Casio Provided or not
It is most likely required for the inflation process. So you cannot easily add the Casio Provided flag without recompressing the whole image.
See: http://www.omnimaga.org/casio-prizm/hac ... halted%29/
It seems to encode the following information:
- type or version of the image format
- program or function used to create it
- Casio Provided or not
It is most likely required for the inflation process. So you cannot easily add the Casio Provided flag without recompressing the whole image.
- critor
- Member
- Posts: 46
- Joined: Wed Jul 24, 2013 3:33 am
- Calculators: Casio fx-7400GII (SH4), Casio fx-9750GII (SH4), Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG50, Casio Classpad fx-CP400
Re: fx-CP400 .c2p image format
Thank you everybody.
I'm now able to generate with my own code .c2p files accepted by the fx-CP400
(tested on both OS 1.00 and 2.00)

I'm releasing the .c2p file format reference I've written and used.
http://tiplanet.org/forum/archives_voir.php?id=86868
I'm now able to generate with my own code .c2p files accepted by the fx-CP400

(tested on both OS 1.00 and 2.00)
I'm releasing the .c2p file format reference I've written and used.
http://tiplanet.org/forum/archives_voir.php?id=86868
- cdi.comics
- Junior Member
- Posts: 2
- Joined: Tue Jan 14, 2014 2:21 pm
- Calculators: Casio Classpad fx-CP400
Re: fx-CP400 .c2p image format
how can I place pictures in classpad2? You could make a toturial or video on youtube.
- critor
- Member
- Posts: 46
- Joined: Wed Jul 24, 2013 3:33 am
- Calculators: Casio fx-7400GII (SH4), Casio fx-9750GII (SH4), Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG50, Casio Classpad fx-CP400
Re: fx-CP400 .c2p image format
For the moment, you've got a beta online generator:
http://tiplanet.org/forum/editgx.php?mode=44
The other way would be do download the above documentation and use a hex editor.
http://tiplanet.org/forum/editgx.php?mode=44
The other way would be do download the above documentation and use a hex editor.
- 1q2w3e4rr
- Junior Member
- Posts: 8
- Joined: Wed Dec 21, 2016 8:29 pm
- Calculators: Casio Classpad fx-CP400
Re: fx-CP400 .c2p image format
hi thank u for what you have done 
i have a problem! when i upload my picture and run the program the picture divide into pieces! how small the picture should be?
and i was searching for hours and i could't fine another program to do this! how someone crate such a format(c2p) and then leave it without no support!

i have a problem! when i upload my picture and run the program the picture divide into pieces! how small the picture should be?
and i was searching for hours and i could't fine another program to do this! how someone crate such a format(c2p) and then leave it without no support!
- critor
- Member
- Posts: 46
- Joined: Wed Jul 24, 2013 3:33 am
- Calculators: Casio fx-7400GII (SH4), Casio fx-9750GII (SH4), Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG50, Casio Classpad fx-CP400
Re: fx-CP400 .c2p image format
Hi and thanks for your post. 
Unfortunately, I don't think the .c2p format readers embedded in the calculator can handle pictures larger than the screen.
Juste choose a smaller image size if you don't want to scroll, hoping that the text is going to remain readable.
There is an official image conversion tool, but Casio will only share it with teachers (I don't remember if they have to pay for it or not).
And anyway, it won't do better than the public online tool.

Unfortunately, I don't think the .c2p format readers embedded in the calculator can handle pictures larger than the screen.
Juste choose a smaller image size if you don't want to scroll, hoping that the text is going to remain readable.
There is an official image conversion tool, but Casio will only share it with teachers (I don't remember if they have to pay for it or not).
And anyway, it won't do better than the public online tool.
10 posts
• Page 1 of 1
Return to Calculator Hacking/Modding Discussions
Who is online
Users browsing this forum: No registered users and 13 guests