Skip to content

Commit

Permalink
chore: compress board images (#131)
Browse files Browse the repository at this point in the history
* chore: optimize images with squoosh

* chore: optimize alumni

* docs: add README for using squoosh
  • Loading branch information
KevinWu098 authored Aug 18, 2024
1 parent 4564bb5 commit df3e308
Show file tree
Hide file tree
Showing 79 changed files with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/assets/images/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Optimizing Images with Squoosh

Squoosh is a fantastic [open-source](https://github.com/GoogleChromeLabs/squoosh) image compression tool by Google usable both as a [web app ](https://squoosh.app/) and as a [CLI tool](https://www.npmjs.com/package/@squoosh/cli). Although the CLI is no longer maintained, it still is useful for bulk compressing images (such as every year's new board members).

## Using the Squoosh CLI

> [!IMPORTANT]
> The Squoosh CLI does not support Node versions 18 and above. **Node 16 is recommended (`nvm use 16`).**
For our directory structure (as of Aug. 2024):

```
DUCI-website
└─ src
└─ assets
└─ images
├─ board
│ ├─ current
│ └─ alumni
└─ merch
├─ ...
```

If you wanted to optimize all images within `current/`, you'd run (at the root):

```
npx @squoosh/cli --mozjpeg '{quality:75}' \
-d src/assets/images/output \
src/assets/images/board/alumni
```

Breaking it down:

1. `npx @squoosh/cli` — calls the Squoosh CLI
2. `--mozjpeg` — a flag converting images to `mozjpeg`
3. `'{quality:75}'` — options
4. `-d src/assets/images/output` — creates a directory with the outputted images at the specified location
5. `src/assets/images/board/alumni` — what file(s) to compress
Binary file removed src/assets/images/board/alumni/Adora_Chen.jpeg
Binary file not shown.
Binary file added src/assets/images/board/alumni/Adora_Chen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/board/alumni/Amy_Steinmetz.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/board/alumni/Amy_Steinmetz.png
Binary file not shown.
Binary file modified src/assets/images/board/alumni/Ava_Lee.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/alumni/Brandon_Gumayagay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/alumni/Candyce_Pham.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/alumni/Carly_Chan.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/alumni/Cinta_Adhiningrat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/alumni/Emily_Huynh.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/board/alumni/Evangeline_Gao.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/board/alumni/Evangeline_Gao.png
Binary file not shown.
Binary file modified src/assets/images/board/alumni/Gabby_Tom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/board/alumni/Iantha_Khan.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/board/alumni/Iantha_Khan.png
Binary file not shown.
Binary file added src/assets/images/board/alumni/Isabel_Pham.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/board/alumni/Isabel_Pham.png
Binary file not shown.
Binary file modified src/assets/images/board/alumni/Jessica_Sotelo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/alumni/Jin_Kim_Niu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/board/alumni/Jolin_Huang.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/board/alumni/Jolin_Huang.png
Binary file not shown.
Binary file modified src/assets/images/board/alumni/Jorina_Chen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/alumni/Karla_Avalos.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/board/alumni/Katherine_Park.jpg
Binary file added src/assets/images/board/alumni/Kristy_Chung.jpg
Binary file removed src/assets/images/board/alumni/Kristy_Chung.png
Diff not rendered.
Binary file removed src/assets/images/board/alumni/Meghna_Kaligotla.jpeg
Diff not rendered.
Binary file modified src/assets/images/board/alumni/Michael_Chang.jpg
Binary file modified src/assets/images/board/alumni/Michelle_Yang.JPG
Binary file removed src/assets/images/board/alumni/Moneer_Ghani.jpeg
Diff not rendered.
Binary file added src/assets/images/board/alumni/Moneer_Ghani.jpg
Binary file removed src/assets/images/board/alumni/Nuo_Yang.jpeg
Diff not rendered.
Binary file added src/assets/images/board/alumni/Nuo_Yang.jpg
Binary file modified src/assets/images/board/alumni/RosalindGuo.jpg
Binary file modified src/assets/images/board/alumni/Samantha_Purganan.jpg
Binary file removed src/assets/images/board/alumni/Sonali_Chellappa.png
Diff not rendered.
Binary file modified src/assets/images/board/alumni/Sunny_Stetsyuk.jpg
Binary file removed src/assets/images/board/alumni/Vanna_Vuong.jpeg
Diff not rendered.
Binary file added src/assets/images/board/alumni/Vanna_Vuong.jpg
Binary file added src/assets/images/board/alumni/Vivian_Chu.jpg
Binary file removed src/assets/images/board/alumni/Vivian_Chu.png
Diff not rendered.
Binary file modified src/assets/images/board/alumni/Yui_Guo.JPG
Binary file modified src/assets/images/board/alumni/Zoya_Soy.jpg
Binary file removed src/assets/images/board/alumni/kaitlen_ngo.PNG
Diff not rendered.
Binary file added src/assets/images/board/alumni/kaitlen_ngo.jpg
Binary file modified src/assets/images/board/current/Aven_Chew.jpg
Binary file modified src/assets/images/board/current/Brandon_Kahn.jpg
Binary file modified src/assets/images/board/current/Caroline_David.jpg
Binary file modified src/assets/images/board/current/Christina_Tran.jpg
Diff not rendered.
Binary file modified src/assets/images/board/current/Elisa_Fuji.jpg
Binary file modified src/assets/images/board/current/Elise_Alinsug.jpg
Binary file removed src/assets/images/board/current/Emma_Choi.jpeg
Diff not rendered.
Binary file added src/assets/images/board/current/Emma_Choi.jpg
Binary file modified src/assets/images/board/current/Grace_Jong.jpg
Binary file modified src/assets/images/board/current/Jamie_Kuang.jpg
Binary file removed src/assets/images/board/current/Janie_Seong.jpeg
Diff not rendered.
Binary file added src/assets/images/board/current/Janie_Seong.jpg
Binary file modified src/assets/images/board/current/Jasmine_Wu.jpg
Binary file modified src/assets/images/board/current/Jessica_Jahja.jpg
Binary file removed src/assets/images/board/current/John_Daniel.jpeg
Diff not rendered.
Binary file added src/assets/images/board/current/John_Daniel.jpg
Binary file modified src/assets/images/board/current/Kaitlyn_Tran.jpg
Binary file added src/assets/images/board/current/Kevin_Wu.jpg
Binary file removed src/assets/images/board/current/Kevin_Wu.png
Diff not rendered.
Binary file modified src/assets/images/board/current/Krey_Daniel.jpg
Binary file modified src/assets/images/board/current/Malina_Miura.jpg
Binary file added src/assets/images/board/current/Megan_Rhee.jpg
Binary file removed src/assets/images/board/current/Megan_Rhee.png
Diff not rendered.
Binary file modified src/assets/images/board/current/Thanusree_Ammisetti.jpg
Binary file modified src/assets/images/board/current/Vimala_Machiraju.JPG
Binary file removed src/assets/images/board/current/Winston_Lee.jpeg
Diff not rendered.
Binary file added src/assets/images/board/current/Winston_Lee.jpg

0 comments on commit df3e308

Please sign in to comment.