reduce export procedure - ojarsbuddy/GIMP-Python-Fu-procedures GitHub Wiki
Some content comes in PDF form, particularly 8.5 in. by 11 in. flyers. It has become tedious to repeat the operations necessary to convert a flyer to images suitable for a web page. The usual intent is to have an interested user click an image to bring up the full PDF, thereby reducing for most users the quantity of data coming from a server.
I had been using a height of 360 px as a standard image dimension but fliers often come to me as 850 px by 1100 px PDF images and the numbers do not divide nicely. In a fit of cleverness, I noticed the aspect ratio 850/1100 = 1700/2200 and reduces to 17/22.
Here is another way to look at this. The list of all positive divisors of 850 is as follows: 1, 2, 5, 10, 17, 25, 34, 50, 85, 170, 425, 850. The list of all positive divisors of 1100 is as follows: 1, 2, 4, 5, 10, 11, 20, 22, 25, 44, 50, 55, 100, 110, 220, 275, 550, 1100. The common divisors are 1, 2, 5, 10, 25, 50. The greatest common divisor is 50.
It is easy to see an incoming 850 px by 1100 px can be neatly converted to 255 px by 330 px without round off. I decided to methodically convert to a height of 330 px for this special case of 8.5 in. by 11 in. content.
What other ratios look promising with respect to reducing bandwidth while maintaining the spirit of the original document? Let's multiply numerator and denominator by increasing integers: {17/22, 34/44, 51/66, 68/88, 85/110, 102/132, 119/154, 136/176, 153/198, 170/220, 187/242, 204/264, 221/286, 238/308, 255/330}
. Perhaps I should someday try 255/308.