Voltar ao ranking

MattKetmo/darkroomjs

JavaScriptmattketmo.github.io/darkroomjs

Extensible image editing tool in your browser

image-processingimage-editingimage-editorimage-cropperimage-cropimage-croppingfabricjs
Crescimento de estrelas
Estrelas
1.5k
Forks
411
Crescimento semanal
Issues
46
5001k
nov. de 2013jan. de 2018abr. de 2022jul. de 2026
Artefatosnpmnpm install darkroomjs
README

DarkroomJS

License MIT

DarkroomJS is a JavaScript library which provides basic image editing tools in your browser, such as rotation or cropping. It is based on the awesome FabricJS library to handle images in HTML5 canvas.

⚠️ IMPORTANT UPDATE

This library has been discontinued and is no longer maintained.

If you're looking for an alternative, you should have a look at Pintura Image Editor.

  • framework agnostic
  • intuitive UI and mobile touch friendly
  • resizing / free rotating
  • color adjustment / photo filters
  • annotating support
  • and much more, try the online demo:

Pintura Image Editor demo

[Demo] Try Pintura Image Editor →

Building

  • Install Node & npm.
  • Run npm install to build dependencies.
  • Run npm start to build the assets and start the demo webserver.

Usage

Simply instanciate a new Darkroom object with a reference to the image element:

<img src="some-image.jpg" id="target">
<script>
  new Darkroom('#target');
</script>

You can also pass some options:

new Darkroom('#target', {
  // Canvas initialization size
  minWidth: 100,
  minHeight: 100,
  maxWidth: 500,
  maxHeight: 500,

  // Plugins options
  plugins: {
    crop: {
      minHeight: 50,
      minWidth: 50,
      ratio: 1
    },
    save: false // disable plugin
  },

  // Post initialization method
  initialize: function() {
    // Active crop selection
    this.plugins['crop'].requireFocus();

    // Add custom listener
    this.addEventListener('core:transformation', function() { /* ... */ });
  }
});

Why?

It's easy to get a javascript script to crop an image in a web page. But if your want more features like rotation or brightness adjustment, then you will have to do it yourself. No more jQuery plugins here. It only uses the power of HTML5 canvas to make what ever you want with your image.

The concept

The library is designed to be easily extendable. The core script only transforms the target image to a canvas with a FabricJS instance, and creates an empty toolbar. All the features are then implemented in separate plugins.

Each plugin is responsible for creating its own functionality. Buttons can easily be added to the toolbar and binded with those features.

Contributing

Run npm develop to build and watch the files while developing.

FAQ

How can I access the edited image?

In order to get the edited image data, you must ask the canvas for it. By doing so inside the callback of your choice (in this case save), you can assign the edited image data to wherever you please.

save: {
      callback: function() {
          this.darkroom.selfDestroy(); // Cleanup
          var newImage = dkrm.canvas.toDataURL();
          fileStorageLocation = newImage;
      }
  }

License

DarkroomJS is released under the MIT License. See the bundled LICENSE file for details.

Repositórios relacionados
opencv/opencv

Open Source Computer Vision Library

C++Apache License 2.0opencvc-plus-plus
opencv.org
90.1k56.9k
roboflow/supervision

We write your reusable computer vision tools. 💜

PythonPyPIMIT Licensecomputer-visionimage-processing
supervision.roboflow.com
48.3k4.4k
ocrmypdf/OCRmyPDF

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched

PythonPyPIMozilla Public License 2.0pythonocr
ocrmypdf.readthedocs.io
34.2k2.4k
lovell/sharp

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

JavaScriptnpmApache License 2.0javascriptwebp
sharp.pixelplumbing.com
32.5k1.4k
JaidedAI/EasyOCR

Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.

PythonPyPIApache License 2.0ocrdeep-learning
jaided.ai
29.8k3.6k
GraphiteEditor/Graphite

Community-built comprehensive 2D content creation appplication for graphic design, digital art, and interactive real-time motion graphics powered by a node-based procedural graphics engine

Rustcrates.ioApache License 2.0graphics-editorphoto-editor
graphite.art
26.6k1.2k
danielgatis/rembg

Rembg is a tool to remove images background

PythonPyPIMIT Licenseimage-processingbackground-removal
23.9k2.4k
amusi/CVPR2026-Papers-with-Code

CVPR 2026 论文和开源项目合集

cvprcvpr2020
22.8k2.8k
amusi/CVPR2025-Papers-with-Code

CVPR 2025 论文和开源项目合集

cvprcvpr2020
19.1k2.6k
amusi/CVPR2024-Papers-with-Code

CVPR 2024 论文和开源项目合集

cvprcvpr2020
18.7k2.6k
ImageMagick/ImageMagick

ImageMagick is a free, open-source software suite for creating, editing, converting, and displaying images. It supports 200+ formats and offers powerful command-line tools and APIs for automation, scripting, and integration across platforms.

COtherimagemagickimage-conversion
imagemagick.org
17k1.6k
lukas-blecher/LaTeX-OCR

pix2tex: Using a ViT to convert images of equations into LaTeX code.

PythonPyPIMIT Licensemachine-learningtransformer
lukas-blecher.github.io/LaTeX-OCR/
16.5k1.3k