Suggestion: Palettes

Discussion and feedback on Construct 2

Post » Sat Mar 17, 2012 11:44 am

A lot of pixel art uses specific palettes. This is partly to keep the size down, but it also allows the image's appearance to be changed on the fly later by simply modifying the palette. I was wondering if it would be feasible to incorporate indexed palettes as an option for Construct 2's Sprites and/or Tiled Background objects? This would allow users to reuse assets by simply specifying a small .pal file, or something similar, as opposed to re-importing a duplicated set of assets with a different palette added in an external image editor.
Construct 2 already compresses images into 8-bit files if asked to, and I believe it can be done with HTML5, as shown here.
B
62
S
26
G
12
Posts: 122
Reputation: 11,330

Post » Sat Mar 17, 2012 4:27 pm

If you want smaller file sizes, just ensure your artwork is 256 color or less and C2 will automatically make it a palette PNG on export (blog post about it). HTML5 doesn't actually natively support palettes, I think the demo you linked to is a very cleverly prepared demo where you split the images in to red, green and blue channels and blend them with different opacities or something like that. So you can't actually switch a palette like the old 8 bit games used to, but you might already be able to fake it by preparing your images and using effects in C2.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Mar 17, 2012 4:46 pm

Ah, I see. Well, thanks for responding.
B
62
S
26
G
12
Posts: 122
Reputation: 11,330

Post » Sat Mar 17, 2012 10:33 pm

@PixelMonkey : Ashley is right. In HTML5, images are stored as matrices, one per color (R,G,B), and Alpha. There's no concept of "indexed paletted image" (i.E. one byte value translating to one entry in the palette).
On that demo, the coder used image from an old Amiga and then DOS code he made. Each image is sent as JSON to the browser, with an index for each pixel translating to an entry in the palette.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Sun Mar 18, 2012 5:08 am

Ok then. Well, it was a nice thought. =b
B
62
S
26
G
12
Posts: 122
Reputation: 11,330


Return to Construct 2 General

Who is online

Users browsing this forum: shinichild, Unconnected and 1 guest