I'll wager you can do better at compression than I can at present, as
I'm almost completely new to this. But that makes it interesting.

It's obviously wrong to focus too heavily on any test set, but I've
bundled together the five images I'm currently testing with, in their
optimal PNG forms, and uploaded to
http://members.allegro.cc/ThomasHarte/temp/SamTestScreens.zip

You should get files screen1 to screen5 (two from Dizzy, three from
Flashback) which as PNGs are sized 5,553, 6,108, 10,643, 10,005 and
11,533 bytes respectively.

The only thing implicit in my output data is that the images are 256
pixels wide. Not all are 192 pixels high but the height is left
implicit from the total number of pixels. Palettes are included with
the images.

With that in mind, I'm currently at 5,531, 7,273, 11,956, 10,538 and
12,367 bytes. But still working on it. So I won't take offence if you
embarrass me thoroughly...

On Thu, Jul 29, 2010 at 4:18 PM, Adrian Brown
<adr...@apbcomputerservices.co.uk> wrote:
> I hope these will support the EEPROM highscore saving or similar ;).  Ive got 
> some strange compression modes, bung me the image and ill see how well i can 
> compress it.  Good to see people looking at the Sam again.  Im hoping to get 
> some more time on Sam Uip soon
>
> Adrian
>
> -----Original Message-----
> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On 
> Behalf Of Thomas Harte
> Sent: 28 July 2010 22:31
> To: sam-users@nvg.ntnu.no
> Subject: Re: Dizzy (was: Porting spectrum games...)
>
> Hmmm, not doing very well with the Flashback image I chose to test
> (the top left screen) at all. PNG is 10,649 bytes and I'm 13,507
> bytes. But unlike yesterday, that's with the Huffman tree stored
> (whoops!) and the palette thrown on. I've also tweaked the LZ77 stage
> a bit, so it's now a 256 pixel rolling buffer with repetitions up to
> 18 pixels in length and the entire screen compressed as one block.
>
> That said, at one point the storage space for all three images seemed
> to go up by about 1.5kb for absolutely no reason. So I don't
> thoroughly trust my code.
>
> I've tried sorting the palette by hue (to give it some sort of
> likelihood that nearby colours are near each other in the palette) and
> applying the various PNG prediction filters to the entire image with
> each and every one causing the file size to grow. Which is quiet
> probably why PNG picks them line by line. So that's the experiment for
> tomorrow night...
>
> On Wed, Jul 28, 2010 at 10:53 AM, Thomas Harte <tomh.retros...@gmail.com> 
> wrote:
>> The previously posted Fantasy World Dizzy map seems to have come from
>> 'Hall of Light', which offers itself as 'the database of Amiga games'
>> at http://hol.abime.net/. You can't just chop up the map and reuse it
>> though, as they've watermarked it with an alpha transparency. It's
>> large but quite spaced out, so I've just used screens that the
>> watermark doesn't touch. And probably if you had a piece of software
>> that was at all competent at reducing colour depth then you'd be able
>> to wash it off again.
>>
>> On Wed, Jul 28, 2010 at 10:03 AM, Stefan Drissen
>> <stefan.dris...@gmail.com> wrote:
>>> For Amiga Treasure Island Dizzy:
>>>
>>> http://www.vgmaps.com/Atlas/Amiga/TreasureIslandDizzy-TreasureIsland.png
>>>
>>> The www.vgmaps.com site has quite a few more cool maps (for example the
>>> Flashback ones in my previous post).
>>>
>>>
>>> Stefan
>>>
>>>
>>> -----Original Message-----
>>> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
>>> Behalf Of Andrew Park
>>> Sent: Wednesday, July 28, 2010 10:29
>>> To: sam-users@nvg.ntnu.no
>>> Subject: RE: Dizzy (was: Porting spectrum games...)
>>>
>>> It is great to see some activity on here again, 1 quick question where did
>>> the amiga dizzy map come from to get screens, i've been looking for good
>>> amiga screenshot maps everywhere as i'm not an artist and this stops me
>>> writing games, i like to see graphical progress when i'm writing.
>>>
>>> Anybody send me a link?
>>>
>>> Andy
>>>
>>> -----Original Message-----
>>> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
>>> Behalf Of Thomas Harte
>>> Sent: 28 July 2010 00:11
>>> To: sam-users@nvg.ntnu.no
>>> Subject: Re: Dizzy (was: Porting spectrum games...)
>>>
>>> Actually, late night spurt - with Huffman trees it's 5,528 bytes and
>>> 6,653 bytes respectively. No predictor yet. The former technically
>>> beats the PNG size, but I'd imagine that just means the predictor is
>>> barely going to help and I'm gaining a small win by not including any
>>> of the normal file padding or headers. Or even the palette.
>>>
>>> On Tue, Jul 27, 2010 at 11:47 PM, Thomas Harte <tomh.retros...@gmail.com>
>>> wrote:
>>>> Further to this: I've been playing around with it today using a couple
>>>> of the more complicated screens from that Amiga map which didn't
>>>> feature the watermark (since it's an alpha transparency, causing the
>>>> number of colours to skyrocket), resized to 256 pixels across (which
>>>> makes 141 pixels high). For a sensible lower bound on what I should
>>>> expect, I saved them as PNGs and ran them through OptiPNG, PNGCrush,
>>>> and AdvPNG, keeping the smallest version.
>>>>
>>>> The first (Dylan and a tree) is 5,553 bytes as a PNG. The second
>>>> (featuring the Armorog) 6,108 bytes.
>>>>
>>>> In my quick dash at compression code, I implemented just a trivial
>>>> little LZ77, using an exhaustive search to pattern match and treating
>>>> each scan line as a completely separate thing to compress (and, as a
>>>> result, rounded up to the next full byte). Five bits for a literal, 17
>>>> for a back reference, the native addressable thing being a nibble.
>>>>
>>>> From that, I got 6,080 bytes for the first screen and 7,170 for the
>>>> second. And this is without yet implementing a Huffman tree (probably
>>>> best done per screen) or any sort of predictor.
>>>>
>>>> So, it looks like on a 16 colour display the LZ77 may actually be the
>>>> most of it. In which case it's going to be hard to support the
>>>> conclusion that PNG is massively better than the various common
>>>> techniques when the Sam was a going concern. A Huffman tree is an easy
>>>> win and something I'll experiment with tomorrow hopefully and a
>>>> predictor is a useful addition even when dealing with hard edged low
>>>> colour graphics because it introduces the second dimension as a going
>>>> concern whereas LZ77 has no concept of that.
>>>>
>>>> Would it be possible to get a single screen hand prepared to be really
>>>> beautiful rather than ripped from a tilemap?
>>>>
>>>> On Tue, Jul 27, 2010 at 10:46 AM, Stefan Drissen
>>>> <stefan.dris...@gmail.com> wrote:
>>>>> Fair enough. You could of course create PNG tiles so that you do not need
>>> to
>>>>> Flash! anything. You could then even also use a 256-colour PNG image as
>>> map
>>>>> editor, the colour determining the tile... ;-)
>>>>>
>>>>> Flashback would be very cool - on the PC I don't remember it having
>>>>> scrolling. You would however also need to create an animated PNG / MPEG
>>>>> player for the animated sequences.
>>>>>
>>>>> Lots of fun things to do... :-)
>>>>>
>>>>> -----Original Message-----
>>>>> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
>>>>> Behalf Of the_wub !
>>>>> Sent: Monday, July 26, 2010 19:21
>>>>> To: sam-users@nvg.ntnu.no
>>>>> Subject: Re: Dizzy (was: Porting spectrum games...)
>>>>>
>>>>> If png's can be used then I think we should do it even if using an
>>>>> image of tiles is a bit ironic!  It would allow changes to be made to
>>>>> the image in the gimp rather than flash! if nothing else! ;)  If a
>>>>> success, I don't dare to dream about scumm but another possible port
>>>>> would be Flashback, I can't remember how much if any scrolling is in
>>>>> there but something would be possible if pngs could be used as source
>>>>> gfx...
>>>>> I don't know enough to comment on the feasibility of it all but I do
>>>>> have a question, why use the PC bitmaps and not the ST?  The Atari is
>>>>> already 16 colours and it would be easy enough to fancy them up a bit,
>>>>> make them a bit less tiley..  I'm saying this without having a good
>>>>> look at how the PC gfx would work in 16 colours though...
>>>>>
>>>>> Hey Warren!  I'd guess that whichever direction the project goes
>>>>> there'll be tons to do.  The more the merrier I say :)
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>
>

Reply via email to