Convert Figma logo to code with AI

GoogleChromeLabs logosquoosh

Make images smaller using best-in-class codecs, right in the browser.

21,699
1,522
21,699
222

Top Related Projects

Minify images seamlessly

29,063

High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.

5,428

Improved JPEG encoder.

Lossy PNG compressor — pngquant command based on libimagequant library

Fast and secure standalone server for resizing and converting remote images

Quick Overview

Squoosh is an open-source image compression web app developed by Google Chrome Labs. It allows users to compress and compare images using various codecs and settings, providing a user-friendly interface for optimizing images for web use.

Pros

  • Offers a wide range of image compression options and codecs
  • Provides a side-by-side comparison of original and compressed images
  • Runs entirely in the browser, ensuring privacy and security
  • Supports modern image formats like WebP and AVIF

Cons

  • Limited batch processing capabilities
  • Lacks advanced features found in some desktop image editing software
  • May be resource-intensive for older devices or browsers
  • Requires an internet connection to access the web app

Getting Started

To use Squoosh, simply visit the web app at https://squoosh.app/. No installation or setup is required. Follow these steps:

  1. Open https://squoosh.app/ in your web browser
  2. Click "Select an image" or drag and drop an image onto the page
  3. Choose your desired compression options from the sidebar
  4. Compare the original and compressed images
  5. Download the optimized image when satisfied with the results

Competitor Comparisons

Minify images seamlessly

Pros of imagemin

  • Extensive plugin ecosystem for various image formats
  • Highly customizable and configurable
  • Can be integrated into build processes and task runners

Cons of imagemin

  • Requires more setup and configuration
  • Command-line interface may be less user-friendly for non-developers
  • Lacks a graphical user interface for easy visual comparisons

Code Comparison

Squoosh (JavaScript):

import {encode} from '@squoosh/lib';

const result = await encode(imageData, {
  mozjpeg: {quality: 75},
  webp: {quality: 80}
});

imagemin (JavaScript):

import imagemin from 'imagemin';
import imageminMozjpeg from 'imagemin-mozjpeg';
import imageminWebp from 'imagemin-webp';

await imagemin(['images/*.{jpg,png}'], {
  destination: 'build/images',
  plugins: [
    imageminMozjpeg({quality: 75}),
    imageminWebp({quality: 80})
  ]
});

Both Squoosh and imagemin offer powerful image optimization capabilities, but they cater to different use cases. Squoosh provides a user-friendly web interface and is great for quick, one-off optimizations. imagemin, on the other hand, excels in automated workflows and offers more fine-grained control through its plugin system. The choice between the two depends on the specific needs of the project and the user's technical expertise.

29,063

High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.

Pros of sharp

  • High-performance image processing library with native bindings
  • Supports a wide range of image formats and operations
  • Designed for server-side use, ideal for batch processing

Cons of sharp

  • Requires installation of native dependencies
  • Limited browser support, primarily for Node.js environments
  • Steeper learning curve for complex operations

Code Comparison

sharp:

const sharp = require('sharp');

sharp('input.jpg')
  .resize(300, 200)
  .toFile('output.jpg');

Squoosh:

import {encode, decode} from '@squoosh/lib';

const image = await decode('input.jpg');
const result = await encode(image, {
  mozjpeg: {quality: 75}
});

Key Differences

  • sharp is a Node.js library, while Squoosh is primarily a web-based tool
  • Squoosh offers a user-friendly GUI, sharp is command-line and API-driven
  • sharp excels in server-side processing, Squoosh targets in-browser optimization
  • Squoosh provides a visual comparison tool, sharp focuses on programmatic control
  • sharp supports more advanced image manipulations, Squoosh emphasizes compression

Both tools have their strengths, with sharp being more suitable for backend processing and Squoosh offering an accessible solution for web-based image optimization.

5,428

Improved JPEG encoder.

Pros of mozjpeg

  • Specialized in JPEG compression, offering superior compression ratios
  • Command-line tool, suitable for server-side and batch processing
  • Widely adopted and integrated into many image processing workflows

Cons of mozjpeg

  • Limited to JPEG format only, unlike Squoosh's multi-format support
  • Lacks a graphical user interface, which may be less user-friendly for some
  • Requires more technical knowledge to use effectively

Code Comparison

mozjpeg (command-line usage):

cjpeg -quality 85 -optimize input.png > output.jpg

Squoosh (JavaScript API):

import {encode} from '@squoosh/lib';
const encodedImage = await encode(imageData, {
  mozjpeg: {quality: 85}
});

Summary

mozjpeg is a specialized JPEG encoder focusing on high-quality compression, while Squoosh is a more versatile image compression tool with a user-friendly interface. mozjpeg excels in JPEG compression and is ideal for server-side processing, but lacks the multi-format support and ease of use that Squoosh offers. Squoosh provides a more accessible approach to image optimization with its web-based interface and API, making it suitable for a wider range of users and use cases.

Lossy PNG compressor — pngquant command based on libimagequant library

Pros of pngquant

  • Specialized for PNG optimization, potentially offering better compression for PNG files
  • Command-line tool, suitable for batch processing and integration into existing workflows
  • Lightweight and focused on a single task, with minimal dependencies

Cons of pngquant

  • Limited to PNG format, while Squoosh supports multiple image formats
  • Lacks a graphical user interface, which may be less user-friendly for some users
  • Does not offer real-time preview or comparison features

Code Comparison

pngquant:

pngquant --quality=65-80 input.png

Squoosh (JavaScript API):

import {encode, decode} from '@squoosh/lib';
const image = await decode(imageFile);
const result = await encode(image, {
  mozjpeg: {quality: 75},
});

pngquant focuses on command-line usage, while Squoosh provides a JavaScript API for programmatic image optimization. pngquant's command is simpler but less flexible, while Squoosh's API allows for more granular control over optimization parameters and supports multiple formats.

Both tools aim to optimize images, but they cater to different use cases and user preferences. pngquant is ideal for users who need quick, efficient PNG optimization through the command line, while Squoosh offers a more comprehensive solution with a user-friendly interface and support for various image formats.

Fast and secure standalone server for resizing and converting remote images

Pros of imgproxy

  • Server-side image processing solution, suitable for high-volume applications
  • Supports a wide range of image formats and processing operations
  • Highly performant, written in Go for efficient resource usage

Cons of imgproxy

  • Requires server setup and maintenance
  • Less user-friendly for non-technical users compared to browser-based solutions
  • May have higher operational costs for small-scale projects

Code Comparison

imgproxy (configuration example):

IMGPROXY_KEY: "your_key"
IMGPROXY_SALT: "your_salt"
IMGPROXY_MAX_SRC_RESOLUTION: 50
IMGPROXY_MAX_SRC_FILE_SIZE: 20971520

Squoosh (browser-based usage):

import {encode} from '@squoosh/lib';

const imageData = await fetch('image.png').then(r => r.arrayBuffer());
const encodedImage = await encode(imageData, {
  mozjpeg: {quality: 75},
});

imgproxy focuses on server-side processing with configuration-based setup, while Squoosh provides a browser-based solution with a JavaScript API for client-side image optimization. imgproxy is better suited for large-scale applications requiring automated processing, whereas Squoosh offers a more interactive and user-friendly approach for smaller projects or individual image optimization tasks.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Squoosh!

Squoosh is an image compression web app that reduces image sizes through numerous formats.

Privacy

Squoosh does not send your image to a server. All image compression processes locally.

However, Squoosh utilizes Google Analytics to collect the following:

  • Basic visitor data.
  • The before and after image size value.
  • If Squoosh PWA, the type of Squoosh installation.
  • If Squoosh PWA, the installation time and date.

Developing

To develop for Squoosh:

  1. Clone the repository
  2. To install node packages, run:
    npm install
    
  3. Then build the app by running:
    npm run build
    
  4. After building, start the development server by running:
    npm run dev
    

Contributing

Squoosh is an open-source project that appreciates all community involvement. To contribute to the project, follow the contribute guide.

NPM DownloadsLast 30 Days