News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Devilmarkus

Test: DSK images as PNG, combined with screenshot

Started by Devilmarkus, 00:17, 13 November 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Devilmarkus

I'm actually experimenting with embedding DSK images into a PNG imagefile.
2 ideas were behind this:
- The filesize will be much smaller than a DSK file
- You can add a screenshot and so, when you have your PNG files in a folder with a gallery function, you'll find quickly, what you are looking for.

So how does this work?
- I compress the dsk image
- I write a screenshot (768x544) into a blank image
- I attach the crunched DSK into the PNG (With a R,G,B pixel write method)

When I load this PNG then, I cut the screenshot, convert the encrypted DSK data back to emulator's DSK format...

Example for a possible disk file:
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

Oh wow. At first I thought maybe the forum db spewed up an April fool's.

So simple to do, and yet so functional! Wish all the emulators adopted this.

Devilmarkus

Quote from: Gryzor on 13:31, 13 November 11
Oh wow. At first I thought maybe the forum db spewed up an April fool's.

So simple to do, and yet so functional! Wish all the emulators adopted this.

Humm no thats no joke ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

Improved the dsk.png format:
Now the dsk data is absolutely invisible! (But attached to the PNG!)

You can check: Download this file and hex edit it...
Look for the word "PNGDIVIDER" and rest is DSK data!!!
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

And another: Batman Forever (Complete DISK image attached to screenshot)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Phi2x

.

Devilmarkus

Well I use the extension .dsk.png
So, also, when you have your fileextension hidden, you'll see a png file with extension .dsk ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Phi2x

.

Gryzor

Heh... very nice. There will be a few practical problems with this, as in you won't be able to double-click an image and have it open in an emulator. Or maybe, if it's got a dsk extension, do file managers look at the file headers or only at the extension in order to display the thumbnail?

[Edit] Ah, Phi2x mentioned those issues already. But, if you go with the zip alternative then... well, there's no reason to it :D Let's just go for CPCGamesCD (hey, no more updates on this front?)!

Devilmarkus

Humm I can open it with:
right click on .dsk.png file -> open with: JavaCPC.exe
So, where's the problem here?

Another solution could work as I already write registry entries (when the user wants! The entries are written when the User chooses that!)
Then you would see a rightclick menu entry:
Mount PNG disk image in JavaCPC

(this entry would then also appear on regular PNG files...)

For DSK, CDT and SNA I already added those entries.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

#12
Here's a Java-Tool to convert DSK + PNG screenshot to dsk.png disk image.
You can also convert .dsk.png back to DSK. (Works only with the last attached files with invisible data area!!!)

If you don't know, how to start it:
create a .bat file. Content:
java.exe -jar DSK2PNG.jar

(In some cases java.exe is not found on your system, then locate your java.exe file in C:\Programs....\java\(version of your java)\bin and add the "full path + \java.exe")

If someone is seriously interested in this format, contact me and ask how it works ;)
I then will send you my java sources to read those files / store a DSK as PNG file...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

TotO

Nice work and very interesting feature! (because I never do it :D)
Do you store the compressed DSK file after the picture?
If yes, it-is like an IdTag, and you may add other useful informations.


Keep the 384x272 PNG format, it look better that 768x544 when you browse pictures. :)
dsk.png was a nice idea too...
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Gryzor

I think a mass conversion utility would be much better, even a command-line one... look into a directory and pair dsks and pngs that have the same name?

Devilmarkus

#15
I updated JavaCPC last night. So simply let it check for Updates.
Load a DSK you like, start it, and when the screen shows the scene you like, press "+" on your numberpad...

Sure it's possible to do a mass conversion. Why not? Will take a look.

The format looks like this:
<png picture><string:PNGDIVIDER><gzipped DSK data>
(!!! The screenshots in this thread use an alternative compression method!!! So herefore you'd need a inflater algorithm! I changed that last night because GZip is more compatible)

When I load it, i cut all incl. the string "PNGDIVIDER" (It's simple to find this string in a byte array). then I load the rest as GZipInputStream.

Example of the structure:
00000000h: 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 ; ‰PNG........IHDR
00000010h: 00 00 03 00 00 00 02 20 08 02 00 00 00 BD 38 99 ; ....... .....½8™
/// snip ///
00001ea0h: 00 04 40 00 04 40 00 04 40 00 34 60 87 BF 32 9E ; ..@..@..@.4`‡¿2ž
00001eb0h: D3 75 C6 EF B1 8A 00 00 00 00 49 45 4E 44 AE 42 ; ÓuÆﱊ....IEND®B
00001ec0h: 60 82 50 4E 47 44 49 56 49 44 45 52 1F 8B 08 00 ; `,PNGDIVIDER.‹..
00001ed0h: 00 00 00 00 00 00 ED D8 CD 8B 24 77 1D C7 F1 5F ; ......íØÍ‹$w.Çñ_
00001ee0h: CF 4C F7 4C CF 43 4F 4F CF 73 4F CF 4C CF 73 0E ; ÏL÷LÏCOOÏsOÏLÏs.
00001ef0h: 09 6A 94 25 87 24 32 EE AE 1A 95 4D 88 AB 04 41 ; .j"%‡$2î®.•Mˆ«.A
/// snip ///
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Bryce

Hmmm, I believe this method has been tried already. Are you sure it has no unexpected side-effects?

Bryce.

Gryzor


Bryce

Then you need to watch the original Willy Wonkas Chocolate Factory.

Or just compare the scene in the first picture to Markus' sample picture in the first post.
(Jokes aren't funny when you have to explain them).

Bryce.

Gryzor


Powered by SMFPacks Menu Editor Mod