Free Image to G-Code

Image to G-code Converter Online
Convert any photos to laser engraving or CNC G-code for Free

Turn any photo or graphic into professional G-code for your laser engraver or CNC machine. Adjust power, speed, and resolution — then download your .gcode file instantly.

Image Preview
Drop image here, or click selectSupports JPG, PNG and WEBP
0%
80%
G-Code Output

Generated G-code will appear here
Upload an image and click Generate to start

What Can You Engrave with Your G-Code?

From personalized gifts to precision industrial parts — image to G-code unlocks a world of making.

Laser Engraving Photos

Convert portraits, landscapes, or pet photos into beautiful laser-engraved artworks on wood, acrylic, or leather.

CNC Routing Art

Generate precise G-code toolpaths from logos or illustrations for relief carving and decorative routing projects.

Custom Gifts & Keepsakes

Engrave personalized names, photos, or messages onto cutting boards, plaques, and jewelry with pixel-perfect accuracy.

Maker & Prototyping

Quickly prototype designs by converting reference images to machine-ready G-code without any CAD software.

Why Our Image to G-Code Converter Delivers Professional Results

S=750 F=3000

Accurate Image to G-Code Raster Conversion

When you convert an image to G-code, pixel-level accuracy is everything. Our Canvas-based algorithm reads every pixel's brightness and maps it to a precise laser power (S value) — delivering smooth tonal gradients that make photo engravings look stunning on any material.

Per-Pixel Accuracy
Grayscale Mapping
Bidirectional Scan
Laser Power (S Value)
S=800
S=600
S=400
S=200
S=50
GRBL · M4 · 1000

Professional GRBL & Marlin G-Code Output

Every image to G-code file generated here is fully compatible with GRBL and Marlin firmware. Supports M3/M4 laser modes, configurable S-max values (255 or 1000), and optimized command merging to keep file sizes small without sacrificing quality.

GRBL Compatible
Marlin Support
M3 / M4 Laser Mode
IMGTrans-image-to-gcode.gcode
GRBLM41.2 MB

Full Control Over Engraving Parameters

Dial in your machine's exact settings: image size in millimeters, pixel resolution, feed rate, travel speed, laser power range, scan direction, and pass count. Advanced B&W threshold mode for crisp line-art engravings. Download your .gcode file in seconds.

Custom Power Range
Speed Control
B&W Threshold

How to Convert Image to G-Code in 3 Steps

From photo to machine-ready file in under a minute.

1
1

Upload Your Image

Drag-and-drop or click to upload any JPG, PNG, or WEBP file. Your image is processed entirely in your browser — never sent to any server.

2
2

Configure Your Machine Settings

Set your desired engraving size, pixel resolution, feed rate, laser power range, and G-code flavor. The image to G-code generation runs entirely client-side with real-time file size estimates.

3
3

Download & Engrave

Click Generate to produce your .gcode file. Copy it to your laser engraver or CNC machine via USB, SD card, or direct connection and start engraving.

The Most Precise Image to G-Code Converter Online

100% Browser-Based

Your images never leave your device. All G-code generation runs in your browser using the Canvas API — no server, no upload, complete privacy.

GRBL & Marlin Ready

Generated G-code is tested for compatibility with the most popular open-source firmware. Works with xTool, Sculpfun, Two Trees, Ender 3 Laser, and most GRBL-based machines.

Professional Power Mapping

Our grayscale-to-S-value algorithm matches professional laser engraving software. Both linear grayscale and binary threshold modes supported for different materials and effects.

Zero Setup Required

No installation, no account, no software. Open the page, upload your image, configure your machine parameters, and download your G-code file instantly — completely free.

Image to G-Code FAQ

Everything you need to know about converting images to laser engraving G-code.

What is an image to G-code converter?

An image to G-code converter is a tool that reads the pixel brightness values from a JPG or PNG image and translates them into G-code commands — the machine language used by laser engravers, CNC routers, and 3D printers. Darker pixels generate higher laser power (S values), while lighter pixels generate lower power or no movement, creating a precise engraving that mirrors the original image.

Which laser engraver and CNC machines are compatible with this G-code?

The generated G-code is compatible with any machine running GRBL or Marlin firmware — the two most common open-source CNC controllers. This includes popular laser engravers like xTool D1, Sculpfun S30, Two Trees TS2, Atomstack A5, Ortur Laser Master, and Ender 3-based laser setups. Select your firmware (GRBL or Marlin) in the Advanced settings.

How do I know what settings to use for my material?

Start with these proven defaults for common materials: Plywood/Basswood — Feed Rate 3000 mm/min, S-MAX 80%; Acrylic — 2500 mm/min, S-MAX 60%; Leather — 4000 mm/min, S-MAX 50%; Cardboard/Paper — 6000 mm/min, S-MAX 40%. Always run a test engrave on a scrap piece first. Slower feed rates and higher S-MAX produce darker, deeper engravings.

What is Grayscale mode vs Black & White mode?

In Grayscale mode, every pixel's brightness is mapped proportionally to a laser power value between S-MIN and S-MAX — producing smooth tonal transitions ideal for photo engravings. In Black & White mode, a threshold slider splits pixels into either full power (black) or zero power (white) — producing crisp, high-contrast results ideal for logos, text, and line art engravings.

Can I use the image to G-code output directly with LightBurn or LaserGRBL?

Yes. The image to G-code file this tool produces is plain-text GRBL G-code that you can open directly in LightBurn (File → Open), LaserGRBL (Open File), or any other G-code sender. You can also load it onto an SD card or send it via USB serial. No conversion needed — it's immediately machine-ready.

What does the Pixel Size setting control?

Pixel Size (in mm) determines how large each image pixel becomes on your workpiece. A 0.1mm pixel size means 10 lines per millimeter (254 DPI equivalent) — suitable for detailed photo engravings. A 0.2mm pixel size gives 5 lines per mm (127 DPI) — faster to engrave but less detailed. Smaller pixel sizes produce finer results but also larger G-code files and longer engraving times.

What image formats are supported?

Our image to G-code converter supports JPG, JPEG, PNG, and WEBP image formats. For best engraving results, use high-contrast images with clear subject separation from the background. Black-and-white photos, silhouettes, and logos with defined edges tend to produce the most impressive laser engravings.