All Projects → MaraniMatias → img2gcode

MaraniMatias / img2gcode

Licence: other
convert jpg, png,gif to gcode with nodejs and jimp

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to img2gcode

alfred-imagemin
Alfred workflow - Minify images with Imagemin
Stars: ✭ 29 (-6.45%)
Mutual labels:  png, jpeg, gif
sail
The missing small and fast image decoding library for humans (not for machines) ⛵ https://sail.software
Stars: ✭ 206 (+564.52%)
Mutual labels:  png, jpeg, gif
Bbwebimage
A high performance Swift library for downloading, caching and editing web images asynchronously.
Stars: ✭ 128 (+312.9%)
Mutual labels:  png, jpeg, gif
Format parser
file metadata parsing, done cheap
Stars: ✭ 46 (+48.39%)
Mutual labels:  png, jpeg, gif
Azpainter
Full color painting software for Unix-like systems for illustration drawing. This is un-official little fixed repository for package maintainers of image editor AzPainter (based on "mlib" toolkit). Official repository - http://azsky2.html.xdomain.jp/arc/download.html
Stars: ✭ 179 (+477.42%)
Mutual labels:  png, jpeg, gif
Lilliput
Resize images and animated GIFs in Go
Stars: ✭ 1,690 (+5351.61%)
Mutual labels:  png, jpeg, gif
gfxprim
Open-source modular 2D bitmap graphics library with emphasis on speed and correctness.
Stars: ✭ 32 (+3.23%)
Mutual labels:  png, jpeg, gif
Libvips
A fast image processing library with low memory needs.
Stars: ✭ 6,094 (+19558.06%)
Mutual labels:  png, jpeg, gif
Omxiv
OpenMax image viewer for the Raspberry Pi
Stars: ✭ 175 (+464.52%)
Mutual labels:  png, jpeg, gif
Essential Image Optimization
Essential Image Optimization - an eBook
Stars: ✭ 1,950 (+6190.32%)
Mutual labels:  png, jpeg, gif
Scrimage
Java, Scala and Kotlin image processing library
Stars: ✭ 792 (+2454.84%)
Mutual labels:  png, jpeg, gif
Gulp Image
Optimize PNG, JPEG, GIF, SVG images with gulp task.
Stars: ✭ 213 (+587.1%)
Mutual labels:  png, jpeg, gif
Pixterm
Draw images in your ANSI terminal with true color
Stars: ✭ 782 (+2422.58%)
Mutual labels:  png, jpeg, gif
StbSharp
C# port of the famous C framework
Stars: ✭ 62 (+100%)
Mutual labels:  png, jpeg, gif
Flyimg
Dockerized PHP7 application runs as a Microservice to resize and crop images on the fly. Get optimised images with MozJPEG, WebP or PNG using ImageMagick. Includes face detection, cropping, face blurring, image rotation and many other options. Abstract storage based on FlySystem in order to store images on any provider (local, AWS S3...).
Stars: ✭ 762 (+2358.06%)
Mutual labels:  png, jpeg, gif
Pyecharts Snapshot
renders the output of pyecharts as png, jpeg, gif, svg, eps, pdf and raw base64
Stars: ✭ 142 (+358.06%)
Mutual labels:  png, jpeg, gif
Sdwebimage
Asynchronous image downloader with cache support as a UIImageView category
Stars: ✭ 23,928 (+77087.1%)
Mutual labels:  png, jpeg, gif
Optimizt
CLI image optimization tool
Stars: ✭ 594 (+1816.13%)
Mutual labels:  png, jpeg, gif
Image Optimizer
Easily optimize images using PHP
Stars: ✭ 2,127 (+6761.29%)
Mutual labels:  png, jpeg, gif
Grunt Image
Optimize PNG, JPEG, GIF, SVG images with grunt task.
Stars: ✭ 201 (+548.39%)
Mutual labels:  png, jpeg, gif

Image to GCode

Convert jpg, jpeg, png, gif to gcode with NodeJS.

  • Generate GCode with absolute coordinates, finds a black pixel if you follow the trail.
  • This version is faster previous versions.
  • Find the shortest path to the next black pixel.

img2gcode with CNC-ino

Installation

$ npm install img2gcode

Quick Start

Depending on the configuration between tool and image height generates better code.

var img2gcode = require("img2gcode");

img2gcode
  .start({
    // It is mm
    toolDiameter: 2,
    scaleAxes: 700,
    deepStep: -1,
    whiteZ: 0,
    blackZ: -2,
    safeZ: 2,
    dirImg: __dirname + '/img-and-gcode/test.jpeg'
  }).then((data) => {
    console.log(data.config);
    console.log(data.dirgcode);
  });

Options

  • toolDiameter (number) Tool diameter. default: 1
  • sensitivity (number) Intensity sensitivity. 0 to 1. default: 0.95
  • scaleAxes (number) Image height in mm. default: image.height equal mm
  • deepStep (number) Depth per pass. default: -1
  • invest { x: (boolean), y: (boolean) } default: {x: false, y: true}.
  • dirImg (string) Image path, accepts JPEG JPG PNG GIF formats.
  • whiteZ (number) White pixels. default: 0
  • blackZ (number) Maximum depth (Black pixels).
  • safeZ (number) Safe distance.
  • info (string) Displays information. ["none" | "console" | "emitter"] default: none
  • feedrate { work: (number), idle: (number) } Only the corresponding line is added. default: ''
  • laser { commandPowerOn: (string), commandPowerOff: (string) } Is you set this options, Z command is will be ignore

Events

Only if Options.info it is "emitter"

  • log Displays information.
  • tick Percentage of black pixels processed. 0 (0%) to 1 (100%).
  • error Displays error.
  • complete Emits at the end with "then".

Method

  • then This function is called to finish saving the file GCode and receives an object: { config , dirgcode }

Examples

var img2gcode = require("img2gcode");
var ProgressBar = require("progress"); // npm install progress
var bar = new ProgressBar("Analyze: [:bar] :percent :etas", { total: 100 });

img2gcode
  .start({
    // It is mm
    toolDiameter: 1,
    scaleAxes: 700,
    deepStep: -1,
    feedrate: { work: 1200, idle: 3000 },
    whiteZ: 0,
    blackZ: -2,
    safeZ: 1,
    info: "emitter", // "none" or "console" or "emitter"
    dirImg: __dirname + "/img-and-gcode/test.png",
  })
  .on("log", (str) => {
    console.log(str);
  })
  .on("tick", (perc) => {
    bar.update(perc);
  })
  .then((data) => {
    console.log(data.dirgcode);
  });

Config for laser options

const options = {
  // It is mm
  toolDiameter: 3,
  sensitivity: 0.9,
  scaleAxes: 128,
  feedrate: { work: 1200, idle: 3000 },
  deepStep: -1,
  laser: {
    commandPowerOn: "M04",
    commandPowerOff: "M05",
  },
  whiteZ: 0,
  blackZ: -3,
  safeZ: 1,
  info: "emitter",
  dirImg: path.normalize(__dirname + imgFile),
};

License.

I hope someone else will serve (MIT).

Author: Marani Matias Ezequiel.


Buy Me A Coffee ☕️

Bitcoin

1N7dWTf1JcvYG2QwviyjwYMw6qY5agx9Qm

Ethereum

0x555d4510b4b3db02d81be5114919e7c8c4156b77

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].