Giter Site home page Giter Site logo

bgrabitmap / lazpaint Goto Github PK

View Code? Open in Web Editor NEW
370.0 370.0 54.0 74.11 MB

🎨 Cross-platform image editor with raster and vector layers similar to Paint.Net written in Lazarus (Free Pascal)

Home Page: https://lazpaint.github.io/

License: GNU General Public License v3.0

Pascal 85.80% Inno Setup 0.68% Shell 0.25% C 9.59% Batchfile 0.16% Python 2.86% Makefile 0.24% Roff 0.05% HTML 0.29% CSS 0.07%
bgrabitmap drawing lazarus lazpaint open-source paint pascal vector-graphics

lazpaint's Introduction

List of directories:

  • bglcontrols: controls providing OpenGL surface with BGRABitmap
  • bgrabitmap: contains BGRABitmap library
  • dev: tools used to make BGRABitmap
  • doc: scripts to generate html documentation (uses pasdoc and graphviz)
  • libwebp: contains the Dll of LibWebP for Windows
  • test: contains a series of test programs and examples on how to use BGRABitmap library
  • winmake: contains batch files for make under Windows

Files:

  • commit.sh: script to commit change from Linux terminal
  • Makefile: generate the code and compile. On Windows, you need to make sure that make.exe from FPC and lazutils.exe from Lazarus tools are in the PATH.
  • update_BGRABitmap.json: package information for OPM in Lazarus

Useful binaries for Windows:

BGRA Controls

lazpaint's People

Contributors

chronoscz avatar circular17 avatar lainz avatar lulu04 avatar omegaxhunter avatar ser82-png avatar suve avatar yambam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lazpaint's Issues

linux64

In releases there is a linux32 build - any possibility of a linux64 one?

Updating BgraUtf8.pas

I have updated BgraUtf8.pas to clear the deprecated messages dealing with methods that make use of FileUtil.pas and LCLProc.pp. The Lazarus 1.5/FPC 3.0+ version have added significantly to the use of UNICODE, UTF8, UTF16 support thoughout the units. The result is that the existing file BgraUtf8.pas creates warnings concerning deprecated methods. My effort has been to make changes to the preferred methods found in LazUTF8 and LazFileUtils.

Alpha mask for layer

An alpha mask feature where you can apply one layer as a mask to another layer would be greatly appreciated -- that and more filters in line with what Paint.NET has and this becomes the sanest, most user friendly image editor available on Linux.

miss lazpaint.zh-CN.po

there is have lclstrconsts.zh_CN.po but not lazpaint.zh-CN.po
can't use zh-cn language
need help

customize toolbars

I work very often visually with mouse and toolbars.
Therefore I would appreciate to have customized toolbar(s) left and top which offer e.g. icons for crop to selection, undo, contrast, rotate.
Pleae add this in the next release
Thank you
Peter

LazPaint doesnt have proper palette edition

It converts to "true color" and then save as "best" 256 color palette.

Here an same image edited and saved with four graphic editors (Paint, Paint Shop Pro 4, PictBear and Lazpaint) to check the difference.


edit: sorry, I will try explain better the problem.

I'm noticed are several image editor saving wrong colors indexes. And only a few do it properly.
Unfortunately LazPaint is one making this wrong.

The number is indicating color index
I will say the color index in this order:
top right square, bottom right square, top left square, bottom left square, center (pink)

This is the original image
https://s6.postimg.org/4cjwgv6up/original_index.png
The color index is: 1, 2, 3, 4, 0 - as indicates the image, of course :P

Now, we will modify and save the image in these programs:
LazPaint, RealWorld Paint, PictBear, Paint Shop Pro 4.

The image edited with LazPaint:
https://s6.postimg.org/slefetwmp/image_Laz_Paint.png
The color index now is: 4, 1, 3, 0, 2 - wrong index

The image edited with RWPaint:
https://s6.postimg.org/6v5lhjskx/image_RWPaint.png
The color index now is: 1, 4, 2, 3, 0 - wrong index

The image edited with PictBear:
https://s6.postimg.org/v06az9cvl/image_Pict_Bear.png
The color index now is: 1, 2, 3, 4, 0 - correct index

The image edited with Paint Shop Pro 4:
https://s6.postimg.org/pq1c7ysmp/image_Paint_Shot_PPro4.png
The color index now is: 1, 2, 3, 4, 0 - correct index

Note: You can view the color index with Paint Shop Pro 4 using the color selector tool
example: https://s6.postimg.org/nb9gnjcdt/psp4_colors.gif

From forum: https://forum.lazarus.freepascal.org/index.php/topic,38074.0.html

TTextStyle.RightToLeft in TextRec not working

TBGRABitmap.TextRec result (the forth line of the image attached) Should be as the TCanvas.TextRec result (the third line of the image attached).

image

and here is the code I used:

procedure TForm1.FormPaint(Sender: TObject);
var
  image: TBGRABitmap;
  TS: TTextStyle;
begin
  image := TBGRABitmap.Create(ClientWidth, ClientHeight);
  image.FontName := Font.Name;
  image.FontHeight := Font.Height;
  TS.Opaque := False;

  TS.RightToLeft := False;
  Canvas.TextRect(Rect(5, 5, 250, 20), 5, 5, 'TCanvas With RightToLeft := False', TS);
  Canvas.TextRect(Rect(250, 5, 500, 20), 250, 5, 'أب+', TS);

  image.TextRect(Rect(5, 20, 250, 35), 5, 20, 'TBGRABitmap With RightToLeft := False', TS, BGRA(0,0,0));
  image.TextRect(Rect(250, 20, 500, 35), 250, 20, 'أب+', TS, BGRA(0,0,0));
  image.Draw(Canvas, 0, 0, False);

  TS.RightToLeft := True;
  Canvas.TextRect(Rect(5, 35, 250, 50), 5, 35, 'TCanvas With RightToLeft := True', TS);
  Canvas.TextRect(Rect(250, 35, 500, 50), 250, 35, 'أب+', TS);

  image.TextRect(Rect(5, 50, 250, 65), 5, 50, 'TBGRABitmap With RightToLeft := True', TS, BGRA(0,0,0));
  image.TextRect(Rect(250, 50, 500, 65), 250, 50, 'أب+', TS, BGRA(0,0,0));
  image.Draw(Canvas, 0, 0, False);

  image.Free;
end;

Compiling in trunk

umultiimage.pas(74,30) Error: Only static methods and static variables can be referenced through an object type

layer groups

folders that can contain layers like embedded LZP file

MultiSelect is disabled if LazPaint is opened with a commandline image

I was wondering why sometimes I cannot select multiple images from a directory and at other times I can. I think I found the cause. If I open LazPaint with no image, I can select multiple images in the file selection dialog, however, if I launched LazPaint with a commandline image, I can only select a single image in the file selection dialog.

Linear gradients of SVG

[BGRABitmap issue]
From the forum
https://forum.lazarus.freepascal.org/index.php/topic,12037.msg335467.html#msg335467

Please fix an issue with the linear gradients of svg, which seems to be not painted, but it's only a size issue.

The issue is in "TSVGElementWithGradient.CreateCanvasLinearGradient(...)" and this code...

    p1.x:= Units.ConvertWidth(g.x1,AUnit,w).value;
    p1.y:= Units.ConvertHeight(g.y1,AUnit,h).value;
    p2.x:= Units.ConvertWidth(g.x1,AUnit,w).value;
    p2.y:= Units.ConvertHeight(g.y1,AUnit,h).value;

...should be...

    p1.x:= Units.ConvertWidth(g.x1,AUnit,w).value;
    p1.y:= Units.ConvertHeight(g.y1,AUnit,h).value;
    p2.x:= Units.ConvertWidth(g.x2,AUnit,w).value;  <- change here
    p2.y:= Units.ConvertHeight(g.y2,AUnit,h).value;  <- change here

After these changes the linear gradients will be painted as expected.

Text style in toolbar

I checked your software. It is small and I like it. But there are two important improvements I suggest.

  1. When we play with text we should see the font style we are working with. Not by clicking a button.
  2. The text direction button as in Microsoft Word is also important to work with complext fonts.

LazPaint cannot save much colored pic as BMP 256 colors

After some editing I have too much colors in pic (i didnt want it),
and now I cannot save pic as BMP 16 color or 256 color. It allows only 24bit.
Pls, ALWAYS enable them, so I can save pic with downsample to 256 colors.

HiDPI on Debian

Terrific software! I would like to suggest minor modifications to support high DPI on Debian systems.

On Debian, the function
ScreenInfo.PixelsPerInchX
always returns 96, regardless of how the user has set the application scaling. The code below can detect the GUI scaling for Debian. Perhaps this could run just once during the initialization of uscaledpi.pas, so Linux systems could use this value if it is not 1.0. It would also be great if we could provide a unified solution on the excellent High DPI - Lazarus Wiki

function getFontScale: single; var AProcess: TProcess; Exe: String; AStringList: TStringList; begin result := 1.0; Exe := FindDefaultExecutablePath('gsettings'); if length(Exe) < 1 then exit; if not FileExists(Exe) then exit; AProcess := TProcess.Create(nil); AProcess.Executable:=Exe; AProcess.Parameters.Add('get'); AProcess.Parameters.Add('org.gnome.desktop.interface'); AProcess.Parameters.Add('text-scaling-factor'); AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes]; AProcess.Execute; if (AProcess.ExitCode = 0) then begin AStringList := TStringList.Create; AStringList.LoadFromStream(AProcess.Output); if AStringList.Count > 0 then result := strtofloatdef(AStringList.Strings[0], 1.0); AStringList.Free; end; AProcess.Free; end; {$ELSE} function getFontScale: single; begin result := 1.0; end; {$ENDIF}

Small translation

If I translated all correctly, is still missing the new menu entry File > Remember save format. That's not in the po file.

layer effects

  • drop shadow
  • stroke around
  • fast blur (box blur?)
  • color/gradient overlay

lazarus 1.8.4 +win10+64bit,build failed

env: lazarus 1.8.4 +win10+64bit

there are lots of error:

  1. Error: Found declaration: SysToUTF8 , SysToUTF16,FileExistUTF8

after add the uses : LAZUtils, LazUTF8,LazFileUtils, to the error units, it seems ok,

  1. the math round() function in uadjustcurves.pas confict with the types.pp
    Error: Found declaration: Round:;--

so, I changed the round() to ceil(), it finally worked.

  1. LCLGetLanguageIDs()not found
    utranslation.pas(79,3) Error: Identifier not found "LCLGetLanguageIDs"

so I commented(disabled) it with //LCLGetLanguageIDs()

Finally, it worked.

Index out of bounds

LazPaint 7.0.5 is unable to duplicate a layer. When I press the appropriate button the "Index out of bounds" message pops up.

BGRASVGType bug.

Lazarus Win32.

If you have svg file with Style Attribute like this:
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.73382717px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"

You got always black, full opaque elements because of

  1. When you call for example:
    val(AttributeOrStyle['fill-opacity'], result, errPos);

  2. In AttributeOrStyle['fill-opacity'] you got '1.00;' (with semicolon), so, you got non zero error code and default value as the consequence.

Error in
procedure TSVGElement.LocateStyleDeclaration(AText: string; AProperty: string; out AStartPos,
AColonPos, AValueLength: integer);

I think AValueLength has wrong value.

Thank you for you lib!

Compiling on macOS

Hi, I finally have the Mac. BGRABitmap, BGRAControls, MaterialDesign, all compiled fine.

When I try to compile LazPaint the first problem I found is this:
if (Clipboard.Formats[i] = PredefinedClipboardFormat(pcfDelphiBitmap)) or

In the clipboard unit.

Maybe you want to install Lazarus trunk on Linux to test as well, is a change on the LCLType unit.

I'm using fpcupdeluxe to install, nothing else works on Mac, but Lazarus trunk and FPC trunk 64 bit.

bring lazpaint to debian

Move closer to make LazPaint as official debian package sometime in the future. So then installation would be as simple as "apt install lazpaint". Also upgrades would be automatic.

EIntOverflow with 32 bit binary

lazpaint

        {$hints off}
        ec.red := (ec.red*($FFFF-gray)+level*gray) shr 16;
        ec.green := (ec.green*($FFFF-gray)+level*gray) shr 16;
        ec.blue := (ec.blue*($FFFF-gray)+level*gray) shr 16;
        {$hints on} 

Hi, this happens when I run LazPaint 'Debug' 32 bit, compiled with Lazarus Trunk and FPC Trunk. When compiled in 'Debug' 64 bit it works fine.

I don't know if is still a good idea to mantain 32 bit Windows, since only really old PC still uses 32 bit.

License

Is there a license? Could you please add a license? Or this is not an open source app?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.