This commit is contained in:
Andros Fenollosa 2024-12-01 10:46:57 +01:00
commit 0629bfa5bf
4 changed files with 90 additions and 0 deletions

34
README.md Normal file
View File

@ -0,0 +1,34 @@
# Place image: Random images for work on web development or design.
![website](demo2.jpg)
## [Download now](https://github.com/tanrax/place-image/releases/download/master/pack-place-images.zip)
(Daily new images)
## [Website](https://place-image.andros.dev/)
(Daily new images)
- 10 random images with random sizes
- 10 people images with 200x200
- 10 square images with 800x800
- 10 rectangle images with 800x400
## Generate your customs images
### Require
- webp: `apt install webp`
- fish: `apt install fish`
### Download
``` bash
curl -L https://raw.githubusercontent.com/tanrax/place-image/master/place-images.fish -o place-images.fish
```
### Run
``` bash
fish place-images.fish
```

BIN
demo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

BIN
demo2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

56
place-images.fish Executable file
View File

@ -0,0 +1,56 @@
#!/bin/fish
# Variables
set SOURCE_DOWNLOAD_IMAGES "https://source.unsplash.com/random/"
set PATH_TEMP "places-images"
set FILENAME_OUTPUT "pack-place-images.zip"
# Remove old images
rm -rf $PATH_TEMP $FILENAME_OUTPUT
# Make folder
mkdir -p $PATH_TEMP/jpg $PATH_TEMP/webp $PATH_TEMP/avif
# Download random images
for i in (seq 1 10)
set FILENAME_IMAGE image-random-$i
curl -L "{$SOURCE_DOWNLOAD_IMAGES}?sig=$i" -o $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg
# Transform jpg to webp
cwebp $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg -o $PATH_TEMP/webp/$FILENAME_IMAGE.webp
# Transform jpg to avif
avifenc $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg -o $PATH_TEMP/avif/$FILENAME_IMAGE.avif
end
# Download square images 800x800
for j in (seq 1 10)
set FILENAME_IMAGE image-square-$j
curl -L "{$SOURCE_DOWNLOAD_IMAGES}800x800/?sig=$j" -o $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg
# Transform jpg to webp
cwebp $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg -o $PATH_TEMP/webp/$FILENAME_IMAGE.webp
# Transform jpg to avif
avifenc $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg -o $PATH_TEMP/avif/$FILENAME_IMAGE.avif
end
# Download rectangle images 800x400
for k in (seq 1 10)
set FILENAME_IMAGE image-rect-$k
curl -L "{$SOURCE_DOWNLOAD_IMAGES}800x400/?sig=$k" -o $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg
# Transform jpg to webp
cwebp $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg -o $PATH_TEMP/webp/$FILENAME_IMAGE.webp
# Transform jpg to avif
avifenc $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg -o $PATH_TEMP/avif/$FILENAME_IMAGE.avif
end
# Download people images 200x200
for l in (seq 1 10)
set FILENAME_IMAGE image-people-$l
curl -L "{$SOURCE_DOWNLOAD_IMAGES}200x200/?people\&sig=$l" -o $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg
# Transform jpg to webp
cwebp $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg -o $PATH_TEMP/webp/$FILENAME_IMAGE.webp
# Transform jpg to avif
avifenc $PATH_TEMP/jpg/$FILENAME_IMAGE.jpg -o $PATH_TEMP/avif/$FILENAME_IMAGE.avif
end
# Zip images
zip -r $FILENAME_OUTPUT $PATH_TEMP
rm -rf $PATH_TEMP