Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement ideas for product images #159

Open
coreymckrill opened this issue Jan 7, 2025 · 0 comments
Open

Improvement ideas for product images #159

coreymckrill opened this issue Jan 7, 2025 · 0 comments

Comments

@coreymckrill
Copy link
Contributor

coreymckrill commented Jan 7, 2025

The current situation with images is that the Product generator will "seed" images by querying for existing images in the Media Library (10 by default), and then if there aren't enough existing images available, it will generate some using the Jdenticon library. This seed query happens for every product generated.

The Jdenticon images look like these:

Image

Quite abstract, but they are simple and relatively efficient to generate. Although, from some basic profiling, it looks like the image part of the product generation command is the biggest bottleneck.

I think this situation could be improved in a few different ways, for different use cases, by adding a parameter to the product generation command for images with options for abstract, realistic, existing, and none:

  • abstract would use the Jdenticon images. But it would generate some up front and stash their IDs in a runtime cache, rather than querying for them every time.
  • realistic would try to sideload images from a placeholder image generator that uses something like Unsplash for a back end (more on this below). This would obviously not be suitable for large batches, but the images could match the products better, which might be more useful in some cases.
  • existing would randomly select existing images from the media library, but not generate anything new. This would probably be the default option.
  • none would not add any images to generated products. This would be useful for large batches of products where the images aren't really the point.

For the realistic option, there are a few different online placeholder image generators available, some of which take a search parameter. This would allow for including the product name in the image query and getting back an image that at least somewhat resembles the generated product. We'd probably want to put a low limit on the number of products that could be generated with this, though (20? 50? 100?). Some placeholder generator options with image querying capabilities:

Some other, more basic placeholder generators:

To compliment the existing option, we could also create a new generator command specifically for product images. That way, images could be generated first, and then could be used when generating products, but much more efficiently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant