how unity builds work

ok what i want to know is how to minimize the size of builds as small as possible, (just for handheld devices).
i have never used unity before so i dont know how it builds games for example,

does it build everything in the project or just what is used in each scene.

does it compress or change file types, i did try having a psd image in the game built it and then removed it and replaced it with a png so the size went from 2mb to 200kb, this was on an object as well in the scene.

but in both builds it was the same size not even a kb difference. so my guess is that it doesnt copy the image files but instead uses its own format of this picture.

im guessing how many pixels used in the image still counts towards the size as well.

if you know what i mean…

anything anyone can tell me to help reduce file save would be appreciated as every little helps…

Unity only includes "used" assets (referenced by any object in any included scene) and the whole content of the "Ressources" folder(s). In any way Unity will store the assets in an optimised format. This can be different depending on the importer settings and the current build target platform.

When you create a build you can find a list of all used assets and their size in the editor log file. Just open the console in Unity and press the "Open editor log" button at the top right. Keep in mind that the editor log is only cleared after a Unity restart, so if you create more than one build you have to search the bottom of the file ;)

Texture importers for example have a max image size setting. It doesn't force an upscaling, but it limits the size if it's larger (downscaling). The original assets are kept untouched.