Recent

Author Topic: LazPaint (alpha-blending, antialiasing, filters)  (Read 651011 times)

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #720 on: April 02, 2015, 11:29:55 pm »
Ok for putting Masks before LCLType.  :)
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #721 on: April 03, 2015, 11:20:00 am »
Description of the tools of version 6.4
(to be tested and compiled)

Brush

Action: draws a stroke with a customisable brush.
How to use it: click and hold the button while you move the mouse

The brush is similar to the pen in most respects, however the shape can be customised and contain a gradiant of opacity. When selecting the brush tool, an additional toolbar appears to specify the shape of the brush.

The first button pops up a window to create a brush that has a regular polygonal shape.

A brush can also be loaded from a file. Such a file can be any format of image. White color means that it is transparent, and black means that it is opaque. Gray indicates shades in between. So a brush is a picture of the brush if it is drawn with a black color on a white background.

A combobox allows to select among loaded brushes. The number of brushes is limited, so keep a directory with your brushes, and load them when you need them. The list of brushes is stored in the configuration, so that if you quit and reopen the programs, the list will be kept.

The spacing parameter specifies the distance between each individual brush pattern along the stroke.

Clone tool

Action: copies an area to another area.
How to use it: RIGHT click on the source and LEFT click on the destination.

The clone tool is similar to a brush, except that the content that is drawn comes from the image itself. The source can be located in another layer. So the full procedure is:

- select the source layer
- RIGHT click on the location in the layer that you want to copy
- select the destination layer (it may be the same layer or another layer)
- LEFT click and hold to draw a copy of the source
« Last Edit: April 03, 2015, 11:27:15 am by circular »
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #722 on: April 06, 2015, 09:32:12 pm »
There is problem of update of the blue area and of the picture when toolbars are shown/hidden.

So there is a new version 6.4.1.
https://sourceforge.net/projects/lazpaint/files/src/

While trying to do the mac version (I had a Mac computer for one day), I fixed some bugs, but there are still some problems:
- Combobox are not owner-drawn, i.e. the drawing is not overriden so it shows the text content instead of the image of the brush or the arrows in the comboboxes
- when saving, update image preview is not shown straight away. We need to do something to make it update itself
- when saving, the filename returned by the save dialog is a strange combination of the filename with itself, like "image.png/image.png". The filename is used as a folder name for itself.

Any idea how to fix these?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #723 on: April 11, 2015, 09:39:21 am »
The 3D now supporting images is now better than photoshop and its about 1000 times faster than ps (well... ::) ).

I've not tested all new stuff but it gets every day better. Keep doing this amazing app!

airpas

  • Full Member
  • ***
  • Posts: 179
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #724 on: April 11, 2015, 10:44:49 am »
bgrabitmap still slower than Aggpas and Graphics32

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #725 on: April 11, 2015, 01:17:51 pm »
Thanks 007!  :) It is much faster than Photoshop or GIMP to load and display images of a small size, and some features are kind of exclusive to LazPaint!  :)

Also LazPaint takes 8 Mb is when GIMP takes 250 Mb.  :)

It is still slow with PNG and there are some minor problems when writing PNGs, so I am considering writing my own PNG reader/writer (now it is basically using FP reader/writer with some minor patches).

I would say that for big images (larger than 1280x1024), Photoshop is faster. LazPaint is very light, that's what makes it fast. However some algorithms could be improved. But honestly I don't have much ideas for optimization. Ironically, optimizing a program takes time! For now I am satisfied with the speed as I don't work with very big images.

Yes airpas, BGRABitmap is slightly slower than AggPas and Graphics32. If you have any idea of improvement, please post them in BGRABitmap thread. What algorithm or method in particular is slow, what other algorithm could be used, etc.?
Conscience is the debugger of the mind

loopbreaker

  • New Member
  • *
  • Posts: 32
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #726 on: April 11, 2015, 06:58:53 pm »
Ironically, optimizing a program takes time!

Hi circular,
you have much experience with SSE.
May I ask about your opinion, how useful http://ispc.github.io
would be? I mean purely hypothetical (technical), for the unreal case
that it would not be a major digression.

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #727 on: April 11, 2015, 08:22:33 pm »
So there is a new version 6.4.1.
https://sourceforge.net/projects/lazpaint/files/src/
While you guys are doing comparisons to Gimp and Photoshop, how does LazPaint (a program I still can't manage to compile for some or other reason) compare to Pixel Image Editor (previously known as Pixel32)?  I've used Pixel for quite a while and it was very impressive with very good color management, effects, brushes, layers, supported platforms etc. I just don't know why Pavel Kanzelsberger suddenly disappeared and stopped Pixel development after 2007/8.


1.  http://www.kanzelsberger.com/pixel/?page_id=5
2.  http://www.thebest3d.com/pixel/
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #728 on: April 12, 2015, 01:14:46 am »
Hi circular,
you have much experience with SSE.
May I ask about your opinion, how useful http://ispc.github.io
would be? I mean purely hypothetical (technical), for the unreal case
that it would not be a major digression.
Hmm, my experience is limited. But definitely having a compiler that does the optimization for you is a great idea. Because an optimized code for SSE is kind of unreadable for a human. However, SSE instructions works for a small number of cases. For example when computing with arrays of single.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #729 on: April 12, 2015, 02:16:20 am »
While you guys are doing comparisons to Gimp and Photoshop, how does LazPaint compare to Pixel Image Editor (previously known as Pixel32)?  I've used Pixel for quite a while and it was very impressive with very good color management, effects, brushes, layers, supported platforms etc.
Pixel Image Editor provides more effects than LazPaint, and the "live effects" on layers gives it some taste of Photoshop. However tools are a bit limited. For example if you draw a rectangle, you cannot resize it. I did not find the text tool easy to use either. There is an undo but no redo. The file format support is also limited (could not load big JPEG files, nor PSD). So I would say that it is kind of unequal. If it had those things fixed, it would be better than LazPaint, and even kind of close to Photoshop. Of course it is not a free software, so that LazPaint would still be cheaper.

As it is, it can be great for some things, but if you need the features I mentionned, LazPaint and Paint.NET have a more consistent base.

Quote
I just don't know why Pavel Kanzelsberger suddenly disappeared and stopped Pixel development after 2007/8.
That's very surprising indeed. I guess that if he cannot continue this software for some reason, he could release the source code as opensource and let other people fix what needs to be fixed. Because for now, it is sad that this code is abandonned.

Quote
(a program I still can't manage to compile for some or other reason)
What error do you get when trying to compile it?
« Last Edit: April 12, 2015, 02:19:16 am by circular »
Conscience is the debugger of the mind

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #730 on: April 13, 2015, 12:47:00 am »
Quote
(a program I still can't manage to compile for some or other reason)
What error do you get when trying to compile it?
I tried to build it under 64-bit FreeBSD. I can't remember the exact errors, but I think it was because it used lots of IFDEF LINUX in the code, thus making such code blocks unavailable for FreeBSD systems.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #731 on: April 13, 2015, 01:52:30 am »
Ah ok. Thanks for trying.

I don't have FreeBSD, so I cannot make sure that it would run on this platform. I would need help for that.

There would be a need for an implementation of BGRABitmap for FreeBSD. Simply replacing IDEF LINUX by IFDEF UNIX may not work, unless there is also Gtk2 on FreeBSD?

Note that for example in MacOS version of Lazarus, some components do not provide some features or are buggy. I don't know if FreeBSD version provides everything that is necessary for LazPaint.

I can only speculate from my computer that runs Windows and Linux.
Conscience is the debugger of the mind

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #732 on: April 13, 2015, 08:19:04 am »
There would be a need for an implementation of BGRABitmap for FreeBSD. Simply replacing IDEF LINUX by IFDEF UNIX may not work, unless there is also Gtk2 on FreeBSD?
Yes, GTK2 exists for FreeBSD. Developing for Linux or FreeBSD (desktop apps) is near identical as they often run the same X11 software (Qt, GTK2/3, Gnome, etc)

What confuses me is why there are so many IFDEF statements inside the (LCL based) application? It isn't as if LazPaint talks directly to hardware or the filesystem etc. So much for Lazarus's tag line of "write once, compiler everywhere"?  ;-)

If you need someone to help test under FreeBSD, I don't mind.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #733 on: April 13, 2015, 12:50:47 pm »
Yes, GTK2 exists for FreeBSD. Developing for Linux or FreeBSD (desktop apps) is near identical as they often run the same X11 software (Qt, GTK2/3, Gnome, etc)
Oh ok. Hmm, we cannot simply replace LINUX by UNIX because some fixes apply to Linux without applying to MacOS. We need to see each case separately. Where does the compilation stop? What line?

Quote
What confuses me is why there are so many IFDEF statements inside the (LCL based) application? It isn't as if LazPaint talks directly to hardware or the filesystem etc. So much for Lazarus's tag line of "write once, compiler everywhere"?  ;-)
Yes, it is not as simple as that. There are minor differences, for example in the way controls behave.

Quote
If you need someone to help test under FreeBSD, I don't mind.
Yes, well you can be the person that test the software for FreeBSD. Testing may not be sufficient if there are particular things to fix. You can tell what does not work, but sometimes debugging is necessary.

Can you send me a screenshot of how FreeBSD renders fonts? It can be anything, menus, text editor, etc. I would like to see if the quality is as good as on Linux to know how much antialiasing to apply. By the way, does BGRABitmap works at all on FreeBSD?
Conscience is the debugger of the mind

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #734 on: April 13, 2015, 03:07:25 pm »
Oh ok. Hmm, we cannot simply replace LINUX by UNIX because some fixes apply to Linux without applying to MacOS.
Yeah, you will probably have to create new defines for UNIX (excluding OSX) and then DARWIN (OSX only).

Quote
Yes, it is not as simple as that. There are minor differences, for example in the way controls behave.
But isn't that what the abstraction layer (LCL) is supposed to hide from the developer? A developer is supposed to simply code for the LCL API, and internally LCL will take care of the different backends. That is how fpGUI works - 99.99% of all fpGUI based applications have no IFDEF's needed in the application code.

Quote
Can you send me a screenshot of how FreeBSD renders fonts?
Again, it works exactly like Linux. FreeBSD uses the exact same Xft/FreeType to render fonts. So hinting etc can also be tweaked to the user preference, just like under Linux.

Quote
By the way, does BGRABitmap works at all on FreeBSD?
I haven't tried for a while. I'll update my local copies of BGRAControls, BGRABitmap and LazPaint and see how far it currently gets and let you know.

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

 

TinyPortal © 2005-2018