Enhancement: Ability to Auto Compress Media Files #727

Open
opened 2026-10-05 03:02:30 +02:00 by adam · 1 comment
Owner

Is your feature request related to a problem? Please describe.

When I upload or add image files to the project via Frontmatter CMS, the images are stored in their original format (e.g., PNG or JPEG). This leads to unnecessarily large file sizes, which negatively impacts loading times and overall performance when showcasing content—especially in documentation contexts where image-heavy pages are common. A built-in image compression and conversion workflow would significantly improve performance and streamline the content publishing process.

Describe the solution you'd like

Ideally, I would like Frontmatter CMS to automatically convert uploaded image assets (e.g., PNG, JPEG) to the .webp format and apply compression to optimize for web usage. The WebP version should then be used in the documentation instead of the original asset, either by replacing the original reference or by exposing an easy way to use the compressed version in Markdown or frontmatter fields.

Optional settings for compression level, fallback formats, and whether to retain the original image would be useful additions.

Describe alternatives you've considered

  • Manually converting and compressing images before uploading them, using external tools or build steps. This is inefficient and error-prone.
  • Using build-time plugins (e.g., in a static site generator pipeline) to compress images post-upload. This works but removes visibility and control during content authoring in the CMS.
  • Creating a custom image processing workflow outside Frontmatter, which increases setup complexity and reduces the benefit of using a CMS in the first place.

Additional context

This feature would be particularly valuable for documentation sites with visual content, as it would enhance load performance and reduce bandwidth. Automating this at the CMS level aligns with the goal of keeping content workflows simple and performance-optimized.

**Is your feature request related to a problem? Please describe.** When I upload or add image files to the project via Frontmatter CMS, the images are stored in their original format (e.g., PNG or JPEG). This leads to unnecessarily large file sizes, which negatively impacts loading times and overall performance when showcasing content—especially in documentation contexts where image-heavy pages are common. A built-in image compression and conversion workflow would significantly improve performance and streamline the content publishing process. **Describe the solution you'd like** Ideally, I would like Frontmatter CMS to automatically convert uploaded image assets (e.g., PNG, JPEG) to the `.webp` format and apply compression to optimize for web usage. The WebP version should then be used in the documentation instead of the original asset, either by replacing the original reference or by exposing an easy way to use the compressed version in Markdown or frontmatter fields. Optional settings for compression level, fallback formats, and whether to retain the original image would be useful additions. **Describe alternatives you've considered** - Manually converting and compressing images before uploading them, using external tools or build steps. This is inefficient and error-prone. - Using build-time plugins (e.g., in a static site generator pipeline) to compress images post-upload. This works but removes visibility and control during content authoring in the CMS. - Creating a custom image processing workflow outside Frontmatter, which increases setup complexity and reduces the benefit of using a CMS in the first place. **Additional context** This feature would be particularly valuable for documentation sites with visual content, as it would enhance load performance and reduce bandwidth. Automating this at the CMS level aligns with the goal of keeping content workflows simple and performance-optimized. <!-- github-sync-id:2962100918 -->
Author
Owner

I have a couple of custom scripts to convert the images to webp, change the image dimensions, etc. There is an issue of creating an extensibility sample library where others can share their scripts: https://github.com/estruyf/vscode-front-matter/issues/680 - I believe that would be a better fit for this enhancement, but it is a great idea! Thank you for opening this one.

I have a couple of custom scripts to convert the images to `webp`, change the image dimensions, etc. There is an issue of creating an extensibility sample library where others can share their scripts: https://github.com/estruyf/vscode-front-matter/issues/680 - I believe that would be a better fit for this enhancement, but it is a great idea! Thank you for opening this one. <!-- github-comment-id:2783023081 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#727