Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.apple2.programmer > #1265
| From | "Bill Buckels" <bbuckels@mts.net> |
|---|---|
| Newsgroups | comp.sys.apple2.programmer |
| Subject | SPRITES in DHGR and SHR - discussion |
| Date | 2014-08-06 16:35 -0500 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <lru72t$cbr$1@speranza.aioe.org> (permalink) |
I have been working these last several days with both SHR and DHGR image fragments AKA Sprites. I wrote a DHGR Sprite Converter similar to the one I did for SHR and as I write this I am making the same simple cc65 demo for DHGR embedded sprites as the SHR demo with the SHR sprite converter. For the DHGR converter, because the resolution is 140 x 192 I provided a scaling feature with 3 variations so the same BMP sprite images can be used in SHR and DHGR, and Windows Paint can be used to create and edit the source images. The DHGR scaling feature's variations are: 1. Scale by pixel reduction (throw away every second pixel). This method is lossy but preserves discrete colors. 2. Scale by error diffusion. The image is first run through an error diffusion routine with two variations, then every second pixel is thrown away. Some aliasing occurs with the background color in both the horizontal and vertical axis. 3. Scale by merging two pixels into one. All three methods work fine. Merging gives the best illusion of detail. Error diffusion seems brighter than merged and is messier but not bad. There is only so much you can do with 16 colors unless dithering which would need to be implemented only on the pixels and not the transparent background or background color. Therefore if I do add dithering, it will need to take place after paletting a mask into place, and then using the mask at the end to blot the dithers on the background. The SHR packed pixel is easiest to use in 2 pixel horizontal movements. If you go to single pixel movements 2 identical sprites are needed with a one-pixel shift. The DHGR sprite is the hardest to deal with. If you go to single pixel horizontal movements 7 identical sprites are needed. But overall Windows Paint can handle the editing easily and everyone has it. I'll have this all ready shortly. I may also come-up with the equivalents for HGR. The 4 colors that we are limited to due to the nature of sprites on demand are really quite restrive compared to DHGR and SHR which has more colors but still suffers from only a 16 color screen-wide palette if sprites want to be in all 15 colors with a background color or mask. Ideally a 4 color sprite would leave room in an SHR palette for background variations. My jury is still out on using reserved sprite colors. The DHGR converter does a fair enough job on non-dithered images, but the fixed palette makes it somewhat less robust, but only marginally. That's pretty much it for me. The color matching is quite good. I have restricted input to 24-bit source images in fixed resolutions. So feel free to comment or just wait a day or so and I'll have this ready. Bill
Back to comp.sys.apple2.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
SPRITES in DHGR and SHR - discussion "Bill Buckels" <bbuckels@mts.net> - 2014-08-06 16:35 -0500 Re: SPRITES in DHGR and SHR - discussion "Bill Buckels" <bbuckels@mts.net> - 2014-08-06 20:36 -0500
csiph-web