Jump to content

Math to scale images to the same pixel surface area proportionally


ultrus

Recommended Posts

I know how to scale images down to a max width/height proportionally, but have an interesting logo challenge.

 

Some logos are tall. Some Logos are wide. Some logos are square. If I were to scale down a tall, wide, and square logo to a max size of 500x500 pixels, graphic gurus would say that the square logo looks huge compared to the others. I would then need to manually resize them all manually to look 'good'.

 

However, if I scaled down each logo to a max surface area of say 5000 total pixels (or something just under that number), that would work better.

 

Would I need to create a loop to calculate the image at smaller increment sizes to figure out what size my new image would be, or is there an easier math solution for that?

 

Any thoughts? I don't need specific php examples. Just trying to get the concept wrapped around my head this Friday afternoon. :D

 

Thanks in advance!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.