Maybe a dumb VRAM question

For questions about using Classic.

Post » Sat Aug 28, 2010 10:21 pm

Hi everyone,

I'm a complete n00b to the idea of directly loading textures into VRAM (previously, I once used RPG Maker long ago, but now I've finally decided to move on to something better, i.e. Construct :)), so please bear with me...

I have read most of the topics here about VRAM and the optimization tips on your wiki, but I just need a clarification on one part: Does the file size on disk, for any power-of-two sprite, change the amount of space it would take within VRAM? An example would be the difference between a 300ppi sprite vs. a 72ppi sprite of the same dimensions - naturally, the 300ppi sprite takes up some more disk space because it is better-defined (usually, 72ppi is used for web graphics, while 300ppi is used for printing), but I don't know if that would make a difference in terms of VRAM.

This may seem like an extremely dumb question, but I was curious if I could get away with things such as...oh, expanding a high pixel-density 256x256 background to 1024x1024, instead of being forced to load a regular 1024x1024 background itself. :P

Thanks for any help.
B
3
G
3
Posts: 3
Reputation: 1,306

Post » Sat Aug 28, 2010 11:36 pm

pixels per inch (ppi) doesn't really apply for on screen graphics. That's more for printing and scanning.
so the actual size such as 1024 pixels is what will matter. if you want it look detailed when zoomed in to take up 1024 pixels by 1024 pixels on screen, that's the resolution it should be at. Not sure what software you're using to get the image data in ppi, but simply right clicking in windows and clicking properties should give you image size in pixels. If you tell me the name of the software, I may be able to help you figure out how to get the image size data how you need it for construct purposes, but if it has a setting for "pixels" that should be it, or a pixel density of 1:1 ratio

also any compression you use, such as jpeg or gif, does not affect the amount of vram it takes up because all images are decompressed into vram, so it's best to use a lossless format like .PNG, because this will give the best quality, including transparency.

Also there are no dumb questions. most of the awesome Constructors asked a ridiculous amount of questions when they first started.

welcome to scirra,

and... please tell me you did the art for your avatar :mrgreen:
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun Aug 29, 2010 12:57 am

[quote="lucid":is2di95l]pixels per inch (ppi) doesn't really apply for on screen graphics. That's more for printing and scanning.
so the actual size such as 1024 pixels is what will matter. if you want it look detailed when zoomed in to take up 1024 pixels by 1024 pixels on screen, that's the resolution it should be at. Not sure what software you're using to get the image data in ppi, but simply right clicking in windows and clicking properties should give you image size in pixels. If you tell me the name of the software, I may be able to help you figure out how to get the image size data how you need it for construct purposes, but if it has a setting for "pixels" that should be it, or a pixel density of 1:1 ratio[/quote:is2di95l]
Oh, okay then. I was curious to see if increasing the pixel density would help me to "cheat" and save a little bit of VRAM, but I suppose not. It is good to know that what image format I use will not matter though, so yay for PNG!

I usually use Photoshop for most of my stuff, but I was also thinking about using TileStudio too, since I don't quite like the workflow for drawing pixel art in Photoshop. :?

[quote="lucid":is2di95l]welcome to scirra,[/quote:is2di95l]
Thanks! :D

[quote="lucid":is2di95l]and... please tell me you did the art for your avatar :mrgreen:[/quote:is2di95l]
No, but I wish I did. :P

It is actually from a recent Japanese manga, published by the U.S. military of all things! It hasn't been translated yet I think, but based on what I've heard from people who understand Japanese, it is essentially a work of kawaii propaganda.
B
3
G
3
Posts: 3
Reputation: 1,306

Post » Sun Aug 29, 2010 3:01 am

The pixel size values define a fixed dimension of a digital image, whereas the ppi is a variable value defining how big the area will be that an image will use when printed out (ergo non-digital).

You may have an image of 512x512 pixel and 72 ppi. If you now change the ppi to 144 the image area on the printed page will be half as big. But on the screen it is exactly the same size (unless you change the monitors resolution from normally 96 dpi to something else, but that would only be a visual difference, the screen will still display 512x512 pixel). It also means that the size on disk does not change for such an image with different ppi values. Try it yourself with photoshop. Create a new picture with 512x512 pixel in 72 ppi and save it as .png, then again create a new picture, this time 512x512 pixel in 144 ppi, and save it as png. Now compare the sizes on disk - they are the same. (Opening them in photoshop will show you that they are still defined as 72ppi and 144ppi)

It is only confusing because photoshop allows you to use the print medium values as definition for a digital image (like 7.1x7.1inch instead of 512x512 pixel), but these values are as described above variable and depend on the ppi. If you would save a 7.1x7.1 inch image in 72ppi, and then one with 142ppi you would just double the pixel size on both axes, so the first one is saved with 512x512 pixel, wheras the second one is saved with 1024x1024 pixel. But both still have the format 7.1x7.1inch.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sun Aug 29, 2010 6:50 am

Tulamide's pretty much nailed it, but even I got confused reading the second last paragraph.

Images are stored with a fixed amount of pixels - eg. 512x512, and that takes up a certain amount of space (format, compression etc).
When it comes to printing, and the dpi/ppi (dots/pixels per inch) is relative to physical size on paper. Monitors are fixed at either 72 or 96 dpi (I'm not certain which). Either way, it doesn't matter on screen because everything is measured in absolute pixels, regardless of resolution or screen size. 512x512 on a 36" monster screen will be physically larger than 512x512 on a cheap 14" LCD.

Paper is a different story, because it doesn't have pixels, rather it has cm/inches. Most printers will do 300dpi at least, but 600 and 1200 dpi aren't uncommon, particularly in laser printers. What happens is your 512x512 image is upsampled to 300/600/1200 dpi by the print driver. Ie. it stretches that 512x512 to 2135x2135 (300 dpi), or 4264x4264 (600dpi).

This is why printing jpgs from the Internet makes them look jaggy and terrible, because they're upscaled so much.
B
2
G
2
Posts: 42
Reputation: 734

Post » Sun Aug 29, 2010 7:00 am

The only thing that could make a difference here besides dimensions is color.
You could try reducing its bit depth, but since everything is saved internally as png... its not going to be a huge reduction.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests