Giter Club home page Giter Club logo

squoosh's Introduction

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.

squoosh's People

Contributors

aisgbnok avatar almandsky avatar alrra avatar andrews05 avatar argyleink avatar aryanpingle avatar atjn avatar beaufortfrancois avatar detachhead avatar developit avatar devnook avatar ergunsh avatar harsh26shah03 avatar jakearchibald avatar jviide avatar kosamari avatar kripken avatar maxgraey avatar mikedelgaudio avatar paulkinlan avatar petele avatar renovate[bot] avatar rreverser avatar styfle avatar surma avatar timvdlippe avatar tsukinoko-kun avatar veluca93 avatar vishalghyv avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

squoosh's Issues

Copy settings to other side

I don't know if this should be V1 or not…

Once we have multiple options, it seems likely that you'll want to compare the difference one setting makes.

Being able to copy a configuration from the left to the right (and vice versa) seems like an easy way to achieve this.

Integrate PNG

  1. WASM PNG Quant #8
  2. Integrate PNG Quant

After that, PNG has a slightly different flow to the other encoders, as it has 'crushers', and sometimes there's a benefit of passing the image through multiple crushers.

  1. WASM two crushers #7 #9
  2. Integrate 'crush' as a checkbox to PNG encoders, which passes the output through PNG crushers.

The main codec may be "Browser PNG" or "PNG Quant" (#8), but then zero or more crushers (#7 #9) can be applied afterwards.

We need to investigate whether the crushers can be run in parallel, or whether there's a benefit to running them in series. I have a feeling that Zopfli PNG is best run at the end, after other crushers. I guess this depends on which crushers work on PNG data, and which work on raw image data.

  1. Stretch goal: Allow each crusher to be enabled/disabled.
  2. Stretch goal: Integrate options for each crusher.
  3. Stretch goal: Show savings provided by each crusher.

Visualising this in the UI is interesting. It'd be nice to show the savings from the main codec, followed by the savings from each crusher. The crushers themselves have options, which dictate how much time they'll spend crushing the PNG.

[mozjpeg] Is `free()` the right thing to do?

Introduced with #28

Our current binding to MozJPEG call free() on the result (see codecs/mozjpeg_emc/mozjpeg_enc.c), as MozJPEG doesn’t seem to provide a custom free call.

We should double-check that this is actually the right thing to do. At some point. Nobody cares about memory leaks, right?

What should happen if we drop multiple images in to the page?

Right now, if we drop multiple images on to the page the app will find the first image in the FileList object and it will open that.

I think the user's expectations would that it the app should handle multiple files 'somehow'.

Here are a couple of potential solutions:

  • Keep it as it is.
  • Show a selector with a list of all valid image files, letting the user select only one.
  • For each image, open up a new instance of squoosh (I think it's classed as a user gesture) and push the image into that new instance.

file-drop element improvements

There are a number of improvements that we can make to the file-drop element that are not directly related to the needs of the app. (see #56 for more context)

  • Add enter and leave events
  • Add .files support to ondrop (filter...)
  • Add valid/in-valid events that map to the css class changes.

Agree on code style & fix linting

At the start we agreed to semistandard, but it seems like nobody particularly likes it, especially the rule that requires a space between a function name and ().

Is anyone using a set of linting rules for this project right now? Might make a good starting point. @developit it looks like you're using one, care to share?

Open example image

On the initial screen we'll give the option to load an example image. I'm thinking:

  • A photo.
  • A photo with alpha.
  • A graphic with gradients and alpha.
  • A graphic that's mostly solid colour with alpha.

…since that covers a few typical cases. However, we shouldn't worry too much about the particular images yet, but the interface to select and load one of these images would be great.

Create config component

It'll need:

  • A drop-down select, to select the codec.
  • Toggles.
  • Range sliders (eg "quality").

This will be a good point for us to review and test the material design implementation, and decide if the off-the-shelf solution is good enough.

No need hooking the form up to anything until #25 is complete, then we can look at how to define configs for each codec.

Build progress bar - more trouble than it's worth?

I feels like we're disabling useful features (like showing address and port number of dev server) because the progress bar doesn't handle it correctly.

If this isn't fixable, we should just get rid of the progress bar.

Drag and drop file loading

This feature will be available on all screens of the app, not just the intro screen.

There should be some kind of drop indicator, but we shouldn't worry too much about the specific design yet.

Integrate design

Parts of the design are coming together, we should start integrating it so we can iterate on it.

[offline/SW] Make worky offline

Later in the project, we need to add a service worker to make the whole offline thing happen.

#77 needs to be considered along with this, as it'll involve a code-update flow that may be out of step with updating the main app.

On-demand loading of codecs

As we land more codecs we should think about user expectations around large downloads.

Maybe load the codecs on-demand when they're first selected? This would involve two steps: 1. The user selects the codec in the dropdown. 2. Instead of options, they get a bit of text explaining the download size, and a button to download. 3. Once downloaded, they get the options.

We'd probably want a "download all" button on the initial page too.

It's too early to do this now, but we should have it in the back of our minds for when it comes to making this work offline.

Vertical two-up

Current mobile designs show the two-up working vertically, so this needs to be a feature of the two-up.

[webpack]Cannot find module './style.scss'. error

  1. npm install
  2. npm run build
  3. errors in finding './style.scss'
  4. npm run build again
  5. -> no more error (why ???)

Error message

ERROR in /Users/kosamari/Code/squoosh/src/components/app/index.tsx
[tsl] ERROR in /Users/kosamari/Code/squoosh/src/components/app/index.tsx(3,24)
      TS2307: Cannot find module './style.scss'.

Remember settings on tab sleep/crash

When the user changes settings for a codec, these should be saved somewhere. When they select that codec later, those settings should be restored.

Because of this, we probably want a "reset" button.

Settings should be remembered for each side of the screen. So side * codec.

The codec selected on each side should be remembered between page loads too.

Download image link

For each compressed image, we need a button that downloads the compressed image.

Bring compressors into master

Right now the project loads an image and displays it in a canvas. It'd be a good first step to output a second canvas that's the same image but put through one of our compressors.

Integrate WebP

This is a little more involved than MozJPEG, as some browsers will need the decoder too.

  • WASM the decoder.
  • Integrate the decoder & enable the encoder for all browsers.

When integrating the decoder, it should be done in a reusable way, so we can do a similar thing for FLIF & AV1.

Image size info

For each image, some human readable information on the size vs the original size.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.