getting the picture size information

Hey guys,

Quick question: Is it possible to get a specific picture's width and height value?
Are you asking by the pixel?
Are you asking by the pixel?
preferably pixel yes.
Depending on your program, simply multiply the tile size by the map size.

Example: My map is 17x20 and my tike size is 48pixels [Tile size of MV tiles]

So you do 17*48 and 20*48 so your map size becomes 816x960 pixels
Depending on your program, simply multiply the tile size by the map size.

Example: My map is 17x20 and my tike size is 48pixels [Tile size of MV tiles]

So you do 17*48 and 20*48 so your map size becomes 816x960 pixels
Hmmm, i think you misunderstood the question. Im looking for a way to get the the pixel length and width of the literal pictures you use in rpg maker mv. Not to calculate the pixel size of rpg makers screen. Like if you have an image of 3 by 4, i want those values to be stored somewhere.
By stored do you mean within a plugin as a value?
This probably requires a plugin to do so, because the objects that manage the Pictures dont read any info from the file, they only accept the values of how they will be shown.
@DianteC I mean where the game stores width and height information from the nonspecific picture in question. For example the width and height values of picture "example1.png" stored in your picture folder, or it could be the hieght and width values of an picture thats stored in the number 43 for example. To me it doesnt really matter which one it is, as long as I know where and if the information is stored.
@DarkHyudrA Hmm, making a plugin for this is probably not worth it. are you sure there is nowhere where rpg maker keeps track of the pictures height and width? Or atleast the height and width of pictures currently shown ingame.
@Monkey BizNiz
If you're talking about, lets say a myimage.png file you can
  1. right click the image
  2. select properties
  3. select details
  4. under image should have the width and height.
They only have the values provided to create the picture, not the values from the original file.
@fimamati I know how to look up information from the actual image, but i want to know if its also automatically stored inside rpg maker mv.
@DarkHyudrA So, that means the width and height of the image after its created should be stored somewhere right? You know, image size + scaling etc.
Yup, the width/height plus the scaleX and scaleY are stored and could be retrieved trought script calls. I just dont know exactly how access them though, Im still learning plugin making in MV.
Oh ok. @Poryg maybe able to help you with this. I just summoned him☺️. Hopefully he can help answer your question. I'm quite sure it stores it because you can resize it within the engine.
So the engine doesn't actually store that info. You can call the image, but you always have to adjust the image for the game or it may be to big or to small. If the engine did in fact store the information it could simply adjust the picture to always fit, which would be a pretty cool feature actually.
All dimensions are stored within the sprite data. Sprite data is stored within $gameScreen.picture(pictureId). So you can for example find $gameScreen.picture(1)._width or $gameScreen.picture(1).width, not sure which is correct. If there is a picture of that ID, it should return the width of the sprite.

However, this returns the width of the sprite modified by scale, so if for example you scale the picture to be half its original size, the width will be half. If you want the original size when a picture is scaled, you need to go ask for the width of the texture!
$gameScreen.picture(1)._texture._width
@Poryg Are you sure thats supposed to work? I tried them both and all i get is "undefined" in the console log. Also when I just do $gameScreen.picture(1) in console log, I cant find width and height in the list.
This is what a tried:

Code:
◆Show Picture:#1, 2, Upper Left (0,0), (100%,100%), 255, Normal
◆Script:console.log($gameScreen.picture(1).width);
:      :console.log($gameScreen.picture(1)._width);
Also the ''$gameScreen.picture(1)._texture._width'' sadly just results in a crash, even if i remove the _'s.
My bad. Picture sprites are located in
SceneManager._scene._spriteset._pictureContainer.children.
And start from 0, not from 1.
So it's
SceneManager._scene._spriteset._pictureContainer.children[pictureId - 1].width

I'm 100% certain on that 😀
@Poryg Thats what i was looking for, thanks dude!

And to everyone else thanks for your assist and suggestions aswell!

Original thread: https://forums.rpgmakerweb.com/threads/getting-the-picture-size-information.94686/