Get Image Actual Resolution

As a Roblox developer, it is currently too hard (or impossible) to get an image’s actual resolution. This means that allowing users to select their own decal/images to display risks making them stretched out if the UIs’ X to Y ratio don’t match the images’.

Having the image resolution/ratio would allow developers to be able to make it so custom user decals would work better in game.


I’d like this as a read-only property.
I always forget what resolution I upload my images at, and properties like SliceCenter and ImageRectSize/Offset rely on that information.


Support, but as quite a low priority feature to add. The thing is you can just open up your documents and get the resolution there. My friend PumpedRobloxian always sends me the pictures along with pictures of their dimensions.



You can’t open up your documents for other user images they want to display in your game on the go…

E.g: you have a house decorating system and allow users to use their own images for paintings. How can you make sure it’s not going to be stretched out without the image resolution/aspect ratio?


Oh right I see, yes I guess that is a problem. I still think it’s fairly low issue though


Well all the little things do add up.

And as @B_rcode pointed out,

So it would barely take any time for roblox to implement this feature - probably like 5 minutes (lol) - because they already have the data, all they need to do is create a read-only property to match.


It’s a perfectly reasonable thing to ask for, and yes we do of course have this information available. It could potentially affect multiple unrelated components though, like ImageLabel, ImageButton, Decal, Texture, MeshPart, etc. Anywhere a bitmap image is used as a source or texture. So maybe 6 minutes… (lol)


Does this mean it will be added? O.O


It will certainly be considered, but I was joking about the 6 minutes of course. While the numbers exist in memory, that’s not half the battle; it rarely is. Bitmap resources aren’t part of the Instance hierarchy, so it’s not a simple task of showing some properties, like it is for the absolute size of UI components. There is already the infrastructure to show properties of these objects that are reflected from C++ to Lua, which is why it’s easier to expose additional ones. It would be a considerably more work for the studio team to add an inspector for the properties of runtime-loaded assets (images, meshes, etc). Getting those numbers from C++ to Lua in a non-hacky way that supports other related requests (e.g. people have asked for triangle counts of meshes), thereby making it worth the effort, is something that has to be discussed and prioritized.


Any chance of this happening anytime soon?


I think this could become handy, the engineers could make it so automaticSize put the actual image dimensions.

Mix that with UIScale and you can resize it however you please


Bump, there’s already a property called ContentImageSize but it’s behind the RobloxScriptSecurity level, making it only accessible by corescripts
It would be neat to make the variable available to developers, i don’t see why it could be an issue.


100%. This is an essential feature that should’ve been available to us a long time ago.

1 Like