npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jpeg-mosher-cli

v1.0.4

Published

moshing jpeg images

Downloads

3

Readme

node-jpeg-mosher

Pure JS CLI that mildly corrupts JPEGs for a moshing-like effect; e.g. introduces creative distortions into the image data.

All Credit goes to knobs-dials, who wrote the original in python (https://github.com/knobs-dials/jpeg-mosh/), and did a lot of interesting research. It's available live at https://mosh.scarfboy.com/.

The test.jpg is from https://commons.wikimedia.org/wiki/File:Jpeg_thumb_artifacts_test.jpg

Requirements

  • Node.js v14+ (uses native ES modules and promises)
  • The ability to tolerate bad software

Installation

  1. Clone this repository or download the script.
  2. Run npm install to install the necessary dependencies.

Usage

Options

  • --output, -o: Path to save the moshed JPEG file. (Default: moshed_image.jpg)
  • --number, -n: Number of files to mosh. (Default: 1)
  • --iterations, -i: Number of iterations to run the moshing process. (Default: 3)

Example

Mosh multiple JPEG files:

node index.js input.jpg -n 3 -o moshed_output.jpg

This command applies the mosh effect to the input.jpg file, saves the output as moshed_output.jpg, and processes the image three times (moshed_output-1.jpg, ...). The original file is not modified.

Notes

Some interesting reading:
- https://helpful.knobs-dials.com/index.php/Image_file_format_notes#Notes_on_JPEG_file_structure
- http://www.opennet.ru/docs/formats/jpeg.txt
- http://www.tex.ac.uk/ctan/support/jpeg2ps/readjpeg.c
- https://svn.xiph.org/experimental/giles/jpegdump.c
- http://fotoforensics.com/tutorial-estq.php  'estimating quality based on quantization tables"
- http://en.wikibooks.org/wiki/JPEG_-_Idea_and_Practice/The_header_part
- http://www.digitalpreservation.gov/formats/fdd/fdd000017.shtml
- https://web.archive.org/web/20240406182506/https://koushtav.me/jpeg/tutorial/2017/11/25/lets-write-a-simple-jpeg-library-part-1/