Skip to content

Add more categories for static images #3810

Description

@matthewmayer

Background

In older versions of Faker, the faker.image module was heavily reliant on multiple third-party image placeholder services e.g. Unsplash, LoremPixel, LoremFlickr and Picsum. Some of these allowed requesting images by categories, e.g. you could generate images right using simple methods like faker.image.cats(), faker.image.nature(), or faker.image.business().

The full list of old category methods was abstract, animals, business, cats, city, food, nature, nightlife, people, sports. technics, transport

Unfortunately over time, several of these providers became rate-limited or went down permanently. As of v10.x, only Picsum survives and it doesn't support categorized images.

In v9.5.0 we tried a new approach for the faker.image.personPortrait API - https://v10.fakerjs.dev/api/image.html#personportrait - it references static images, originally generated by an opensource GenAI image modal, in a seperate repo served via the jsdelivr CDN.

This new approach seems to have worked smoothly, and has quietly become very popular, with 1.7M requests/week made to the assets-person-portrait repository.

Proposal

It seems there is an opportunity to add more similar categorized static images that are not dependent on a specific third party provider.

Similar to faker.image.personPortrait we would support a fixed range of sizes (square only) and perhaps some simple parameters.

This issue can be for general discussion of the API and upvoting. If you have a specific method to propose e.g. faker.image.animal({type:"cat|dog"}) please add as a seperate sub-issue and reference this one.

Metadata

Metadata

Assignees

Labels

c: featureRequest for new featurem: imageSomething is referring to the image module

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions