DMarby / picsum-photos

Lorem Ipsum... but for photos.
https://picsum.photos
MIT License
2.2k stars 152 forks source link

Use cases #107

Closed golombi closed 11 months ago

golombi commented 11 months ago

I'm using your great service and wanted to know if it fits my purpose -

How do you generate the small images (let's say 11*11)?

Are they cropped from larger images at random places by any chance?

Regards and appreciation,

Golombi.

DMarby commented 11 months ago

Larger images are resized and then cropped as needed indeed to fit to the correct aspect ratio. Under the hood this uses libvips vips_thumbnail_buffer function which tries to pick visually interesting parts of an image when deciding what to crop.

You can find all images here: https://picsum.photos/images

https://www.libvips.org/API/current/libvips-resample.html#vips-thumbnail https://github.com/DMarby/picsum-photos/blob/e6342529b7e6b9ff6762843f9a5c5191b6e574e3/internal/vips/vips-bridge.c#L19-L21

golombi commented 11 months ago

Thank you for the quick and detailed response:)