This problem is related to programing, for which I am searching an optimal solution.
Problem: I have some images in different height to width ratios. I want to make them in ratios of 1:1 or 3:4 or 4:3, by adding white space. I want to add as little white space as possible, to make it in any of the 3 given ratio. I never want to reduce.
Currently my solution is to create 3 new images for 3 given ratios and then checking for which the program needed to add the least no. of pixel. I then go with that. However currently I am adding pixel to only one side, which I have found is not good and in some cases adding pixel to both the side reduces total no. of white pixel added.
I also have tried searching google, but I don't know what this problem is called i.e what to search for. Hence I am here seeking an insight from you.
I hope the solution to this problem will be with in the limits of high school Maths as anything beyond it, will make the solution harder to implement.