# Tidy up my thumbs

**URL:** <https://forum.getkirby.com/t/tidy-up-my-thumbs/8279>\
**Category:** Questions\
**Tags:** v2\
**Created:** [August 17, 2017, 8:38pm UTC](https://forum.getkirby.com/t/tidy-up-my-thumbs/8279 "2017-08-17T20:38:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thewebprojects](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thewebprojects/32/10107_2.png) [@thewebprojects](https://forum.getkirby.com/u/thewebprojects)\
**Post date:** [August 17, 2017, 8:38pm UTC](https://forum.getkirby.com/t/tidy-up-my-thumbs/8279/1 "2017-08-17T20:38:56Z")

</div>

Hi. I adjusted how my images optimze/resize the images after the site launched in an effort to further shrink 'em. I’d like to remove unused images. I suspect I can just remove the folders in my ‘thumbs’ directory and the site will regenerate all the necessary images on the fly. Right?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 17, 2017, 8:54pm UTC](https://forum.getkirby.com/t/tidy-up-my-thumbs/8279/2 "2017-08-17T20:54:51Z")

</div>

Yes (and some more characters).

---

<div class="post-metadata">

**Author:** ![thewebprojects](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thewebprojects/32/10107_2.png) [@thewebprojects](https://forum.getkirby.com/u/thewebprojects)\
**Post date:** [August 17, 2017, 9:09pm UTC](https://forum.getkirby.com/t/tidy-up-my-thumbs/8279/3 "2017-08-17T21:09:52Z")

</div>

Cool. Thanks (and some more characters)!

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [August 18, 2017, 9:28am UTC](https://forum.getkirby.com/t/tidy-up-my-thumbs/8279/4 "2017-08-18T09:28:49Z")

</div>

I use NPM scripts to do this automatically during build:

```
"config": {
  ...
  "content": "./public/content",
  "thumbs": "./public/thumbs",
  ...
},
"scripts": {
  ...
  "images:content:min": "imageoptim -d $npm_package_config_thumbs && imageoptim -d $npm_package_config_content && find $npm_package_config_content -name '*.svg' -type f -exec svgo {} \\;",
  ...
}

```

Requires [Imageoptim](https://imageoptim.com/mac), [Imageoptim CLI](https://github.com/JamieMason/ImageOptim-CLI) and [SVGO](https://github.com/svg/svgo) installed. Will optimise all images and SVG files recursively in the content and thumbs folders. Don’t use the quality settings on Kirby’s image helpers because you will effectively be compressing images twice, which can look bad if your not careful.

Whilst this does use a Mac only app to do the optimising, windows folks can get a similar result by swapping it out for [Imagemin](https://github.com/imagemin/imagemin-cli) which is cross platform.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:32pm UTC](https://forum.getkirby.com/t/tidy-up-my-thumbs/8279/5 "2025-02-06T17:32:20Z")

</div>


