
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
dither-me-this
Advanced tools
Generate dithered images at build time for your static website.
this project is not ready for production
For now this project is not working with any static site generator. But you can still test out the code:
Download the project
Install the dependencies:
npm install canvas fs-extra
Put images in the input
folder
npm run start
in your terminal
Dithered images are placed in the output
folder
const options = {
ditheringType: "errorDiffusion" // errorDiffusion, ordered, random, noDither
// Error Diffusion Dithering options
errorDiffusionMatrix: "floydSteinberg", // Keyword or matrix (not yet implemented)
serpentine: false // NOT YET IMPLEMENTED
// Ordered Dithering Options
orderedType:'bayer', // No other option yet implemented
orderedMatrix:[4, 4] // Minimum 1, maximum 8 ... for now
// Random Dithering Options
// Random Dithering shouldn't be used except for educational purposes
randomDitheringType: "blackAndWhite",
// Color Options
palette: 'default', // palette name | Color[]
threshold:50, // to lighten and darken images (this should probably be automatic)
// Automatic Color Options
sampleColorsFromImage:false,
numberOfSampleColors:10
}
Dithering is a method of reducing the colors in an image and emulating the missing colors with strategically placed dots.
It's used to display images in print or on devices with a limited color range.
It has the modern advantage of reducing the file size of images in a stylistic way.
To learn more Wikipedia has a good article.
You can also play with the client-side version: Dither Me This.
Static Dither will be built to work with static site generators, such as 11ty.
It should take an image in the form of an <img>
tag with a source:
<img src="https://example.com/image">
or <img src="./images/example.jpg">
and some options such as a set of sizes, dithering options, and a color palette
and produces a set of dithered images in webp
and png
form and a <picture>
element containing <source>
elements pointing to those images.
However, Because static site generators all work differently. It's yet to be determined how this project will achieve that goal with each static site generator.
To achieve the main goal other packages will (probably) need to be made for each static site generator. Those packages will have this one as a dependency and deal with the particulars of that static site generator.
png
and webp
Before anything else... A good experience for the end user of the images.
Then, a good developer experience.
Then, readable code so others can learn from it.
Then, finally, the speed of the dithering itself. If an optimization makes it harder for someone to understand the code it won't be merged.
Feel free to contribute to this project. Remember the Project Priorities, and please follow the code of conduct.
See CODE_OF_CONDUCT.md
FAQs
Dither images at build time for static site generators.
The npm package dither-me-this receives a total of 28 weekly downloads. As such, dither-me-this popularity was classified as not popular.
We found that dither-me-this demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.