not a power of 2?

JimBrand

Grumpy Old Trainz Addict
When fixing faulty assets and you get this message:

Error: The texture 'orange.bmp' is not a power of 2, please resize it.

What does that mean? Shrink the image by 1/2? How do i fix these faulty assets?
 
Image sizes in trainz should be by the power of 2 so you need to use :

1x1 2x2 4x4 8x8 16x16 32x32 64x64 128x128 256x256 512x512 1024x1024 2048x2048

or you can mix and match to suit the texture

256x128 512x64 1024x512 2048x32 etc but only from the selection of numbers above .
 
You will find the same error comes up frequently with BMP and TGA texture files on old assets. The meaning of 'power of 2' is that both the width and the depth of the image file must be multiples of 2. For example the sizes can be;
2x2=4 pixels
2x2x2=8 pixels
2x2x2x2=16 pixels
2x2x2x2x2=32 pixels
2x2x2x2x2x2=64 pixels
2x2x2x2x2x2x2=128 pixels
2x2x2x2x2x2x2x2=256 pixels
and so on.

You need to resize either the width, or the depth, or both dimensions so that the sizes in pixels are multiples of 2. This can be done with any graphics software such as Paint.net or Gimp and save the file under the same name. Make sure when saving the file that you do not use any image compression and if it is a TGA I use 24 bit.

Scottish
 
Powers of 2, not multiples, and one dimension can be upto 8 times the other. Max usually of 2048x2048
 
i,am using Irfanview trying to resize to the power of 2 right now it say it 512x460 so when i try to change it it goes right back to the size is there any step by step on how to resize bmps
 
In Irfanvies, just type in the new sizes and it will resize, then save in same format as original (bmp or tga)
 
I've tried every number i just can't figure it out. Maybe i'am not doing it right i started 640x480 to 1920x1080 it's still saying it's not the power of 2
 
That is correct, you are wrong.

A power of 2 is 2 multiplied by 2 multiplied by 2 etc

So anything from 2, 4,8,16,32,64,128,256,512,1024,2048 and the same for the other size, one side may be 8 times the other but not more

So you need 512 x 512
 
Correct me if I'm wrong, but a 512 x 460 image can't be resized to a power of 2. The 512 dimension is already a power of 2, so if the 460 dimension is resized to a power of 2, it changes the 512 dimension. At least that's what happens when I try to resize an image. To get the image resized would require cropping the image wouldn't it (eg: crop it to 460 x 460 and then resize it). Of course, cropping it would probably mess up the mapping of the image.

Mike
 
You are wrong !!

Th 512 is a power of 2, but the other dimension isnt

Unlick the keep aspect ratio and resize the other dimension to 512

Once mapped the mapping wont change (or shouldnt) you can try this by resizing to 1024x512, it will distort the image, but the mapping should be OK

CROPPING WILL effect the mapping. Have a play and you will see the effects.
 
Thanks Paul for the clarification. It's not the first time that I've been wrong and I'm sure that it won't be the last. I had thought about unclicking the 'keep aspects ratio', but as you say, it would distort the image. I'll have to give it a try and see how it works.

Mike
 
Another possibility would be to copy the 512 x 460 image and paste it into a new 512 x 512. There would be no distortion but there would be some spare space (512 x 52) - which might sometimes be useful - and of course mapping in a 3D design program would need some adjustment. I usually make sure that when I create a texture it is copied and pasted like this before doing any 3D mapping.

Ray
 
I have always found that a square texture file (like the orange texture above) set to a power of two works best, but hey that's just me.

Cheers :)

AJ
 
OK guys i am new at this the current size is 512x460 the new size is 512 x 460 . where do i type the numbers into set new size or set new size as percentage of original. i am working on the loco dash 8 csx 7545 Grey Ghost kuid 98966:51019:1 by the way it's in a TGA forum
 
Last edited:
I don't know which program you're trying to use to resize it, but if you're using IrfanView, then once you open the file, go to the Image/Resize Resample tab and in that window, uncheck the 'Preserve Aspect Ratio' box. Then you can change the size to 512 x 512 or any other size that is a power of 2.

Mike
 
Open the tga with Irfnview

then FILE RESIZE

Untick the Preserve Aspect Ratio then change the width or height to be a power of 2

then SAVE
 
Back
Top