Author Topic: Test: DSK images as PNG, combined with screenshot  (Read 6402 times)

0 Members and 1 Guest are viewing this topic.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
    • Awards
Test: DSK images as PNG, combined with screenshot
« on: 01:17, 13 November 11 »
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:

like
0
No reactions
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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #1 on: 14:31, 13 November 11 »
Here you can see how nice it is to load these files:
http://java.cpc-live.com/png_disks/
like
0
No reactions
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

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 17.102
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #2 on: 14: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.
like
0
No reactions

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #3 on: 14:32, 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 ;)
like
0
No reactions
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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #4 on: 15:33, 13 November 11 »
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!!!

like
0
No reactions
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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #5 on: 15:37, 13 November 11 »
And another: Batman Forever (Complete DISK image attached to screenshot)

like
0
No reactions
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

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #6 on: 16:12, 13 November 11 »
.
« Last Edit: 18:00, 30 June 21 by PhilZeVibe »
like
0
No reactions

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #7 on: 16:15, 13 November 11 »
Well I use the extension .dsk.png
So, also, when you have your fileextension hidden, you'll see a png file with extension .dsk ;)
like
0
No reactions
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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #8 on: 16:26, 13 November 11 »
Compare:



like
0
No reactions
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

Offline PhilZeVibe

  • 464 Plus
  • *****
  • Posts: 471
  • Country: 00
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #9 on: 16:34, 13 November 11 »
.
« Last Edit: 18:00, 30 June 21 by PhilZeVibe »
like
0
No reactions

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 17.102
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #10 on: 16:40, 13 November 11 »
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?)!
like
0
No reactions

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #11 on: 18:01, 13 November 11 »
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.

like
0
No reactions
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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #12 on: 19:46, 13 November 11 »
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...
« Last Edit: 23:14, 13 November 11 by Devilmarkus »
like
0
No reactions
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

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 4.023
  • Country: fr
    • ?area=showdonations;u=4
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #13 on: 00:30, 14 November 11 »
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...
like
0
No reactions
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 17.102
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #14 on: 09:30, 14 November 11 »
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?
like
0
No reactions

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #15 on: 10:00, 14 November 11 »
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:
Code: [Select]
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 ///
« Last Edit: 10:07, 14 November 11 by Devilmarkus »
like
0
No reactions
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

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 12.465
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #16 on: 10:35, 14 November 11 »
Hmmm, I believe this method has been tried already. Are you sure it has no unexpected side-effects?

Bryce.


« Last Edit: 10:38, 14 November 11 by Bryce »
like
0
No reactions

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 17.102
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #17 on: 19:56, 14 November 11 »
Didn't get it!
like
0
No reactions

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 12.465
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #18 on: 20:44, 14 November 11 »
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.
« Last Edit: 20:45, 14 November 11 by Bryce »
like
0
No reactions

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 17.102
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
    • Awards
Re: Test: DSK images as PNG, combined with screenshot
« Reply #19 on: 21:36, 14 November 11 »
...or successful :p
like
0
No reactions