dhowe / AdLiPo

Replacing ads with generative language
https://rednoise.org/adlipo
2 stars 4 forks source link

[Climate] Identify set of common ad aspect-ratios #45

Closed dhowe closed 2 years ago

dhowe commented 2 years ago

To replace our colored rectangles with random images from our image-set, we need a way to match the aspect ratio, then scale the image to the appropriate size for the ad rectangle on the page.

If we can identify a standard set of ad image ratios, then we can pre-select images for the image-set to match them...

Real-John-Cheung commented 2 years ago

I collected some ads with adnauseam and calculated their ratios

{
//'ratio':frequency
  '1.34': 1,
  '3.70': 1,
  '8.09': 8,
  '0.27': 3,
  '0.67': 1,
  '1.20': 12,
  '3.88': 3,
  '3.22': 1,
  '1.00': 4,
  '1.91': 2,
  '1.92': 1,
  '0.50': 1
}

Generally there are two kinds of them: banner-like (vertical & horizontal) and photo-like (landscape & portrait) to simplify it below is the ratio of the longer side to the shorter side

  '1.34': 1,
  '3.70': 1,
  '8.09': 8,
  '3.75': 3,
  '1.50': 1,
  '1.20': 12,
  '3.88': 3,
  '3.22': 1,
  '1.00': 4,
  '1.91': 2,
  '1.92': 1,
  '2.00': 1

for photo-like ads most of the ratio are close to 4:3 , I think we can use 4:3 images for ads whose ratio are between 1 - 1.5. a few ads have the ratio around 2:1 banner-like ads are more various... but many of their ratios are around 3.2 - 4, which is about 32:9 and some are in very strange shapes like 8:1, for those maybe we just ignore.

to concludes, I propose we prepare images 4 (4:3, 3:4, 32:9 and 9:32) to 6 (previous 4 plus 2:1 and 1:2) different ratios

dhowe commented 2 years ago

great -- let's see what we can find for these 6 ratios: 4:3, 3:4, 32:9, 9:32, 2:1, 1:2 (I'll make a new ticket)

would be good to know what the largest size for each is as we can always downscale

meantime, for your testing, perhaps just create the 6 with a single bright color

Real-John-Cheung commented 2 years ago

would be good to know what the largest size for each is as we can always downscale

The longest width/height is less than 1000px, so I think we can aim for images in this scale: 4:3 960x720 2:1 1000x500 or 800x400 32:9 1920x540

dhowe commented 2 years ago

see #49 for progress on collection