Standardizing 250 car photos a week without Photoshop (a 20‑line Python job)
Описание и применение
Автоматизация стандартизации 250 фотографий автомобилей в неделю без Photoshop: 20‑строчный скрипт Python использует API для удаления фона, добавления тени и скрытия номера, обеспечивая единый внешний вид.
Задача
Dealership photos have inconsistent backgrounds, making listings look unprofessional and confusing.
Результат
Processed ~250 car photos weekly in under 20 lines of Python, achieving consistent backgrounds and drop shadows without Photoshop.
Рабочий процесс
- 1. Set API key and endpoint URL. 2. Choose mode (e.g., fg-image-shadow). 3. Define source (inbox) and destination (ready) directories. 4. Create destination directory if it doesn’t exist. 5. Loop over each JPG in the source folder. 6. POST image to API with mode and API key. 7. Check response status; if not ok, log and skip. 8. Extract base64 PNG from entities where kind=="image". 9. Decode base64 and write PNG to destination. 10. Log conversion. 11. Optionally run the loop in a ThreadPoolExecutor for parallelism.
Доказательства
Requests are independent, so for a few hundred cars wrap the loop body in a ThreadPoolExecutor and run 8–16 at a time.
an image the service can't read still comes back as HTTP 200.
- Дата записи: 2026-09-22T12:00:33.338Z