Difference between revisions of "LazPaint"

From Lazarus wiki
Jump to navigationJump to search
(→‎Interface: undo 200)
(Small fixes; do/redo=>undo/redo)
Line 46: Line 46:
 
Many common actions can be done with the toolbar. Zoom can be changed with the magnifying glass (+ or -), or by clicking on the 1:1 button to show the image at its original size in pixels, or with the zoom fit button to set the zoom so that the whole image be within the window.
 
Many common actions can be done with the toolbar. Zoom can be changed with the magnifying glass (+ or -), or by clicking on the 1:1 button to show the image at its original size in pixels, or with the zoom fit button to set the zoom so that the whole image be within the window.
  
It is possible to do/undo the 200 last operations. If you have a doubt on what you are drawing, undo back to the beginning, save a copy, and redo the modifications before going further.
+
It is possible to undo/redo the 200 last operations. If you have a doubt on what you are drawing, undo back to the beginning, save a copy, and redo the modifications before going further.
  
 
=== Windows ===
 
=== Windows ===
  
The main window allows to draw, and there is also a color circle window and a toolbox. Use the color circle window to select a color, its luminosity and its opacity. The toolbox offers a wide range of drawings tool and selection tools.
+
The main window allows to draw, and there is also a color circle window and a toolbox. Use the color circle window to select a color, its luminosity and its opacity. The toolbox offers a wide range of drawing tools and selection tools.
  
 
=== Selection ===
 
=== Selection ===
  
Selection is composed with rectangles, ellipses and pen drawing. It contains levels of transparency, so that the border of an elliptic region has antialiasing. If you do a hole in your bitmap, the border will be antialiased, and if you draw a gradient inside an elliptic selection, the border will be with antialiasing.
+
Selection is composed with rectangles, ellipses and pen drawing. It contains levels of transparency, so that the border of an elliptic region has antialiasing. If you cut a hole in your bitmap, the border will be antialiased, and if you draw a gradient inside an elliptic selection, the border will be with antialiasing.
  
 
With the left button you can add elements to the selection, and with the right button, you can remove elements from it. The selection can be released with a button on the toolbox or by hitting Enter.
 
With the left button you can add elements to the selection, and with the right button, you can remove elements from it. The selection can be released with a button on the toolbox or by hitting Enter.
Line 60: Line 60:
 
The rotation tool allows to rotate the current selection with a free angle.
 
The rotation tool allows to rotate the current selection with a free angle.
  
Selection fit option reduces the selection to non transparent pixels.
+
The selection fit option reduces the selection to non transparent pixels.
  
 
=== Input file formats ===
 
=== Input file formats ===
Line 66: Line 66:
  
 
With layers :
 
With layers :
* LZP : LazPaint file format
+
* LZP : LazPaint file format
 
* ORA : OpenRaster exchange file format
 
* ORA : OpenRaster exchange file format
 
* PDN : Paint.NET images
 
* PDN : Paint.NET images
Line 81: Line 81:
  
 
With layers :
 
With layers :
* LZP : LazPaint file format
+
* LZP : LazPaint file format
 
* ORA : OpenRaster exchange file format
 
* ORA : OpenRaster exchange file format
  
Line 92: Line 92:
  
 
=== Image manipulation ===
 
=== Image manipulation ===
Image can be resampled, flipped horizontally and vertically.
+
An image can be resampled, flipped horizontally and vertically.
  
Smart zoom x3 : resize the image x3 and detects borders, to have a useful zoom with ancient games sprites.
+
Smart zoom x3 : resize the image x3 and detects borders; this provides a useful zoom with ancient games sprites.
  
 
=== Color manipulation ===
 
=== Color manipulation ===
Line 109: Line 109:
 
Filters can be applied to the whole image or to the active selection.
 
Filters can be applied to the whole image or to the active selection.
  
*Radial blur : non directional blur
+
* Radial blur : non directional blur
*Motion blur : directional blur
+
* Motion blur : directional blur
*Custom blur : blur according to a mask
+
* Custom blur : blur according to a mask
  
*Sharpen : makes contours more accute, complementary to Smooth
+
* Sharpen : makes contours more accute, complementary to Smooth
*Smooth : softens whole image, complementary to Sharpen
+
* Smooth : softens whole image, complementary to Sharpen
*Median : computes the median of colors around each pixel, which softens corners.
+
* Median : computes the median of colors around each pixel, which softens corners
  
*Contour : draws contours on a white background (like a pencil drawing)
+
* Contour : draws contours on a white background (like a pencil drawing)
*Emboss : draws contours with shadow
+
* Emboss : draws contours with shadow
  
*Sphere : spherical projection
+
* Sphere : spherical projection
*Cylinder : cylinder projection
+
* Cylinder : cylinder projection
*Clouds : add clouds of the current pen color
+
* Clouds : add clouds of the current pen color
  
 
=== Command line ===
 
=== Command line ===
Line 129: Line 129:
 
  lazpaint inputfile [/command1 [/command2...]] [outputfile]
 
  lazpaint inputfile [/command1 [/command2...]] [outputfile]
  
On Linux, command prefix is '-'.
+
On Linux, the command prefix is '-'.
on Windows, command prefix can be '-' or '/'.
+
on Windows, the command prefix can be '-' or '/'.
  
 
==== Line without command ====
 
==== Line without command ====
Line 140: Line 140:
 
==== Line without output file ====
 
==== Line without output file ====
  
If you do not specify an output file, the application is opened with the resulting image. For example :
+
If you do not specify an output file, the application is opened with the resulting image. For example:
 
  lazpaint image.png /RotateCW
 
  lazpaint image.png /RotateCW
 
will open the image with a 90° rotation.
 
will open the image with a 90° rotation.
Line 169: Line 169:
 
==== Filter commands ====
 
==== Filter commands ====
  
You can apply filters with default values. Here is the list of filter commands :
+
You can apply filters with default values. Here is the list of filter commands:
  
 
'''Blur filters :''' BlurPrecise, BlurRadial, BlurFast, BlurCorona, BlurDisk, BlurMotion, BlurCustom
 
'''Blur filters :''' BlurPrecise, BlurRadial, BlurFast, BlurCorona, BlurDisk, BlurMotion, BlurCustom

Revision as of 18:46, 27 February 2013

lazpaint preview.jpg


LazPaint is an image editor, like PaintBrush or Paint.NET, written in Lazarus (Free Pascal). It uses the library BGRABitmap to draw.

The drawing takes into account the level of transparency (alpha channel), shape borders are rendered with antialiasing, and color composition includes gamma correction.

Support this project

How to use it

Useful keys

  • Ctrl key aligns to image pixels and limits possible angles with rotation tool
  • Backspace key erases last point in a polygon or last letter in a text
  • Enter key releases selection

Right mouse button can be used to:

  • Swap drawing colors temporarily
  • Subtract from selection (selection tool)
  • Define light position (shaded text, shaded shapes)
  • Finish a shape (polygon, curve)

Tutorials

Video tutorials are available on Youtube :

Download

Binaries can be downloaded on Sourceforge for Windows and Linux.

http://sourceforge.net/projects/lazpaint/files/bin/

You can also download the source code and compile it for a specific platform. MacOS version is a bit experimental.

Screenshots

Lazpaint curve redim.png

Interface

Many common actions can be done with the toolbar. Zoom can be changed with the magnifying glass (+ or -), or by clicking on the 1:1 button to show the image at its original size in pixels, or with the zoom fit button to set the zoom so that the whole image be within the window.

It is possible to undo/redo the 200 last operations. If you have a doubt on what you are drawing, undo back to the beginning, save a copy, and redo the modifications before going further.

Windows

The main window allows to draw, and there is also a color circle window and a toolbox. Use the color circle window to select a color, its luminosity and its opacity. The toolbox offers a wide range of drawing tools and selection tools.

Selection

Selection is composed with rectangles, ellipses and pen drawing. It contains levels of transparency, so that the border of an elliptic region has antialiasing. If you cut a hole in your bitmap, the border will be antialiased, and if you draw a gradient inside an elliptic selection, the border will be with antialiasing.

With the left button you can add elements to the selection, and with the right button, you can remove elements from it. The selection can be released with a button on the toolbox or by hitting Enter.

The rotation tool allows to rotate the current selection with a free angle.

The selection fit option reduces the selection to non transparent pixels.

Input file formats

Images can be loaded with the toolbar or with the File menu.

With layers :

  • LZP : LazPaint file format
  • ORA : OpenRaster exchange file format
  • PDN : Paint.NET images

Flat :

  • BMP : uncompressed bitmaps
  • GIF : user can choose a frame if animated
  • ICO : icon, user can choose a size
  • JPG : lossy compression
  • PCX : personal computer exchange
  • PNG : portable network graphic

Output formats

With layers :

  • LZP : LazPaint file format
  • ORA : OpenRaster exchange file format

Flat :

  • BMP : uncompressed bitmaps
  • JPG : lossy compression
  • PCX : personal computer exchange
  • PNG : portable network graphic
  • XPM : X pixmap

Image manipulation

An image can be resampled, flipped horizontally and vertically.

Smart zoom x3 : resize the image x3 and detects borders; this provides a useful zoom with ancient games sprites.

Color manipulation

  • Colorize : set the color of an image while preserving intensities
  • Shift colors : cycle colors and change colorness (saturation)
  • Intensity : make colors lighter or darker without making them white
  • Lightness : make colors lighter or darker by making them whiter
  • Normalize : use the whole range of each color channel and alpha channel
  • Negative : invert colors (with gamma correction)
  • Linear negative : invert colors (without gamma correction)
  • Grayscale : converts colors to grayscale with gamma correction

Filters

Filters can be applied to the whole image or to the active selection.

  • Radial blur : non directional blur
  • Motion blur : directional blur
  • Custom blur : blur according to a mask
  • Sharpen : makes contours more accute, complementary to Smooth
  • Smooth : softens whole image, complementary to Sharpen
  • Median : computes the median of colors around each pixel, which softens corners
  • Contour : draws contours on a white background (like a pencil drawing)
  • Emboss : draws contours with shadow
  • Sphere : spherical projection
  • Cylinder : cylinder projection
  • Clouds : add clouds of the current pen color

Command line

General use :

lazpaint inputfile [/command1 [/command2...]] [outputfile]

On Linux, the command prefix is '-'. on Windows, the command prefix can be '-' or '/'.

Line without command

You can omit commands to convert an image to another file format. For example :

lazpaint image.pdn image.png

will flatten and save a Paint.NET image into a PNG.

Line without output file

If you do not specify an output file, the application is opened with the resulting image. For example:

lazpaint image.png /RotateCW

will open the image with a 90° rotation.

Line without input file

You can also create an image out of nothing. For example :

lazpaint /New(800,600) /Gradient(255,255,255,255,0,0,0,255,Linear,0,0,800,600) blackwhite.png

will create an image with a black and white gradient and save it into blackwhite.png.

General commands

Here is the list of supported commands :

  • /HorizontalFlip : flips image horizontally
  • /VerticalFlip : flips image vertically
  • /SwapRedBlue : swaps red and blue channels
  • /RotateCW : rotates image clockwise
  • /RotateCCW : rotates image counterclockwise
  • /Resample(Width,Height: Integer) : resample image to Width x Height
  • /Opacity(Value: Byte) : applies a global factor to opacity
  • /Gradient(red1,green1,blue1,alpha1,red2,green2,blue2,alpha2: Byte; type; x1,y1,x2,y2: Single) : draws a gradient. Type can be Linear, Reflected, Diamond or Radial.
  • /New(Width,Height) : creates a new empty image of Width x Height

For example :

lazpaint bigimage.bmp /Resample(320,200) smallimage.png

will save a small copy of bigimage.bmp into smallimage.png

Filter commands

You can apply filters with default values. Here is the list of filter commands:

Blur filters : BlurPrecise, BlurRadial, BlurFast, BlurCorona, BlurDisk, BlurMotion, BlurCustom

Pixel filters : Sharpen, Smooth, Median, Emboss, Contour, Grayscale, Negative, LinearNegative, Normalize, SmartZoom3

Deformation filters : Sphere, Twirl, Cylinder, Plane

Rendering filters : PerlinNoise, CyclicPerlinNoise, Clouds, CustomWater, Water, Wood, WoodVertical, Plastik, MetalFloor, Camouflage, SnowPrint, Stone, RoundStone, Marble

For example :

lazpaint photo.jpg /Contour /Emboss /Normalize

will transform the image into a carved stone.