Welcome, Guest. Please login or register.

Author Topic: HAM-like hack allows full-color GIFs  (Read 2304 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline FloidTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2003
  • Posts: 918
    • Show only replies by Floid
HAM-like hack allows full-color GIFs
« on: August 29, 2004, 04:08:05 PM »
Another Slashdot find.

Check out the demonstration image, courtesy of this guy...

...then learn   the secret behind it.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: HAM-like hack allows full-color GIFs
« Reply #1 on: August 29, 2004, 04:34:10 PM »
I can't see what's HAM-like in this.
 

Offline Gojirax

  • Full Member
  • ***
  • Join Date: Aug 2004
  • Posts: 178
    • Show only replies by Gojirax
Re: HAM-like hack allows full-color GIFs
« Reply #2 on: August 29, 2004, 04:55:18 PM »
Because HAM (Hold and Modify) uses a similar function I think. Since that was a GIF Animation, once it rendered one square, it was able to load a new pallete for the next square.

It does seem like a second cousin to HAM. :)

But that's just from my limited understanding.
 

Offline minator

  • Hero Member
  • *****
  • Join Date: Jan 2003
  • Posts: 592
    • Show only replies by minator
    • http://www.blachford.info
Re: HAM-like hack allows full-color GIFs
« Reply #3 on: August 29, 2004, 05:24:26 PM »
No, HAM uses extra bits to change the colour value of a pixel.

This uses multiple images to generate the illusion of more colours, you could do this on the Amiga as well, I was experimenting with it in DPaint on an A1200 many years ago.
 

Offline Ilwrath

Re: HAM-like hack allows full-color GIFs
« Reply #4 on: August 29, 2004, 05:35:38 PM »
Quote
It does seem like a second cousin to HAM. :)


It's just a multi-palletted image.  Probably closer to the DynamicHAM like that NewTek viewer used than a true HAM mode.

I'm not really sure what mangling the GIF format to do this really accomplishes, though.  There's already a plethora of formats for high-color modes.  And, of course, the only programs that can use this format must support animated GIFs.  And, not much besides web browsers really do that, anymore.  (And since browsers also support JPEG, TIFF, PNG, etc...)  

I'm just not seeing a purpose here, other than, perhaps to win a bet about how many colors can be displayed in a GIF...  ;-)


 

Offline FloidTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2003
  • Posts: 918
    • Show only replies by Floid
Re: HAM-like hack allows full-color GIFs
« Reply #5 on: August 29, 2004, 06:43:06 PM »
Quote

Ilwrath wrote:
Quote
It does seem like a second cousin to HAM. :)


It's just a multi-palletted image.  Probably closer to the DynamicHAM like that NewTek viewer used than a true HAM mode.
It's HAM-like in the sense that it's a neat hack. ;-)

Quote
I'm not really sure what mangling the GIF format to do this really accomplishes, though.  There's already a plethora of formats for high-color modes.  And, of course, the only programs that can use this format must support animated GIFs.  And, not much besides web browsers really do that, anymore.  (And since browsers also support JPEG, TIFF, PNG, etc...)

I'm just not seeing a purpose here, other than, perhaps to win a bet about how many colors can be displayed in a GIF...  ;-)
"Hack value," one assumes, though you know there's got to be that one legacy system out there... and plenty of MS-DOS viewers handled animated GIF before anyone'd even heard of JPEG.  Maybe it'd come in handy for some sort of suitably ridiculous democompo, and if not, it's a neat way to 'celebrate' the patents finally expiring.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: HAM-like hack allows full-color GIFs
« Reply #6 on: August 29, 2004, 09:56:17 PM »
@floid

As hacks go its interesting but it relies on the fact that the screen on which the gif is shown is capable of showing each frame in full colour.

It's a hack in that it allows the file to represent an image with more than 256 colours, not display more than that many on an 8-bit display.

As such, it wouldn't work on a 256 colour screen.
int p; // A
 

Offline minator

  • Hero Member
  • *****
  • Join Date: Jan 2003
  • Posts: 592
    • Show only replies by minator
    • http://www.blachford.info
Re: HAM-like hack allows full-color GIFs
« Reply #7 on: August 29, 2004, 10:12:48 PM »
Quote
It's a hack in that it allows the file to represent an image with more than 256 colours, not display more than that many on an 8-bit display.

As such, it wouldn't work on a 256 colour screen.


No, thats the point, it does allow >256 colours even on a 256 colour screen.

The screen itself only displays 256 colours at a time but your brain will combine the frames so you will "see" a different image with more colours.
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: HAM-like hack allows full-color GIFs
« Reply #8 on: August 29, 2004, 10:14:54 PM »
It didn't work here.
int p; // A
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: HAM-like hack allows full-color GIFs
« Reply #9 on: August 29, 2004, 10:31:29 PM »
@minator

Karlos is right. It doesn't allow >256 col on 256 col screen.

For that you'd need to use interlace or palette switching tricks, but that's not used here.


BTW, it's possible to have 32768 colours with OCS amiga.
 

Offline FloidTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2003
  • Posts: 918
    • Show only replies by Floid
Re: HAM-like hack allows full-color GIFs
« Reply #10 on: August 29, 2004, 11:07:20 PM »
Quote

minator wrote:
Quote
It's a hack in that it allows the file to represent an image with more than 256 colours, not display more than that many on an 8-bit display.

As such, it wouldn't work on a 256 colour screen.


No, thats the point, it does allow >256 colours even on a 256 colour screen.

The screen itself only displays 256 colours at a time but your brain will combine the frames so you will "see" a different image with more colours.
Whoever said it first got it right.  The GIF *format* is limited to 256 colors/image, but apparently allows these to be tagged (like Amiga 'pens,' among other Amigan things... at least, I think 'pen' is a safe word to use here) out of a truecolor space.  (Who knew, especially if you were raised on an IBMalike?)

Meanwhile, animated GIF was a simple hack to begin with -- basically a number of GIF images concatenated -- and combined with the format's transparency support, you can guess how it all comes together here.  No dithering, no tricks to display >256 colors on a low-color display, just an amusingly novel way to get beyond the "256 color" limitation in the specification itself... and a nice optimization puzzle, if you'd want to try to write a generic converter that obtains maximum compression.