one optimization technique question

For questions about using Classic.

Post » Thu Jul 23, 2009 10:37 am

[quote="newt":34znu1w1]How do you get an alpha channel into a jpeg?[/quote:34znu1w1]

jpg doesn't support alpha channels AFAIK...
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Thu Jul 23, 2009 3:40 pm

[quote="newt":2oanwzjz]How do you get an alpha channel into a jpeg?[/quote:2oanwzjz]

An excellent point that nobody else bothered to bring up :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jul 23, 2009 4:33 pm

[quote="newt":2su23nmr]How do you get an alpha channel into a jpeg?[/quote:2su23nmr]

1. Open it in Photoshop

2. Press CTRL+ALT+SHIFT+S

3. Under the file dropdown box, choose PNG24

4. ?????

5. PROFIT!!!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Thu Jul 23, 2009 5:02 pm



JPG



PNG + it has alpha support
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Thu Jul 23, 2009 8:51 pm

yeah actually.... jpg is designed for photos.
If your image is not a photo it will probably look horrible in jpg.
Only use jpg for high-res photo-like images that have no alpha and are to be loaded on runtime. For anything else go with PNG.

I'm using jpg for photo background images :P
Oh and you can control the compression error in JPG. Of course, as error is reduced, size approaches (and surpasses) that of a PNG.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Jul 25, 2009 8:51 pm

I think I was misunderstood. when I said uncompressed .png I meant the way construct stores sprites in .cap file. At least the way I read on this forum, It stores image as uncompressed .png thus making .cap file pretty big when working with high res pictures.

So my idea was to store this images externally in compressed format, be it .jpg,.png or .dds. then use load frame event to load image into game.

And DDS is good alternative to both jpg and png, its well compressed, stores alpha channels, mipmaps etc and does not reduce quality as highly compressed jpg. I have not tested dds with construct to see what features are supported, but dds is used in many 3D games with great success.

Dunno how it will perform in 2d game, most of its features have to do with 3d space. [like mipmap?]
B
24
S
7
G
3
Posts: 138
Reputation: 2,795

Post » Sat Jul 25, 2009 9:53 pm

I wonder if the space savings would be that different between a zip (or rar, 7z, etc.), containing a cap which has all the graphics embedded in it, versus a zip containing a cap and all the maximum-compressed png files?

I am thinking a compressed archive might do a good enough job on the cap with embedded graphics, if they really are not compressed somehow, and would probably do practically nothing on compressed png files. So it might even it out a bit.

Well, it's just a thought, and might be worth checking.

(As a not really related aside: For space savings locally, after the compressed archive is extracted, those using NTFS could use compression on the cap or exe, to bring its size down a bit.)
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Sat Jul 25, 2009 10:38 pm

[quote="hellwalker":3v21xob5]I think I was misunderstood. when I said uncompressed .png I meant the way construct stores sprites in .cap file. At least the way I read on this forum, It stores image as uncompressed .png thus making .cap file pretty big when working with high res pictures.[/quote:3v21xob5]
I still don't understand what you're talking about... Construct stores images in PNG format in the .cap, which is compressed. I don't know what you mean by "uncompressed .png" because .png files are always compressed.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sun Jul 26, 2009 12:55 am

Actually, it seems it is possible to create uncompressed PNG files.
The two graphics programs I work with, GIMP and IrfanView, have a setting for the compression level when saving a png, with possible values of 0 through 9 (lowest to highest). On 0, what IrfanView says is no compression, a PNG file's size will end up very, very close to the filesize as the identical image in BMP format. I tried it with a few images, and the files ended up within roughly 1000 bytes of each other.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Sun Jul 26, 2009 1:26 am

Oh, OK. But as far as I know, Construct uses a relatively high compression, maybe not maximum but still a high setting.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests