Lazarus

Programming => Graphics => Graphics and Multimedia => BGRABitmap and LazPaint => Topic started by: circular on February 06, 2011, 02:23:42 am

Title: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 06, 2011, 02:23:42 am
LazPaint is a painting program like PaintBrush or Paint .Net implementing drawing functions directly in Free Pascal. (Donate) (http://sourceforge.net/donate/index.php?group_id=404555)

Layers can be combined with various blend modes. The drawing takes into account the level of transparency (alpha channel), shape borders are rendered with antialiasing, and color composition includes gamma correction.

With help from the Lazarus community LazPaint has been successfully compiled to work on Windows, Linux Mint, Puppy Linux and MacOS.

It is on GitHub :
https://github.com/bgrabitmap/lazpaint

Wiki help here :
http://wiki.lazarus.freepascal.org/LazPaint

Features
Layered file formats
LZP (read/write): LazPaint file format
ORA (read/write): OpenRaster exchange file format
PDN (read): Paint.NET images
oXo (read): PhoXo images
PSD (read flattened): Photoshop images

Flat images
BMP (read/write): uncompressed bitmaps (including with alpha channel, however many programs do not read the transparency information)
GIF (read(write): user can edit a frame if animated
ICO/CUR (read/write): icon, user can edit a size
JPEG : the well known compression however lossy
PCX (read/write) : Personal Computer eXchange
PNG (read/write) : Portable Network Graphic
TGA (read/write) : also called Targa
TIFF (read/write) : not all compression modes are supported
WebP (read/write) : Google Web image
XPM (read/write) : X PixMap (small C-like format)
XWD (read) : X Window Dump (screen capture)
DNG, CR2, NEF, ARW... (read) : Raw images from camera

Color manipulation
Curves : adjust curves of RGBA channels or by hue, luminosity, saturation.
Posterize : use a reduced number of values for RGB or for luminosity
Colorize : set the color of an image while preserving intensities
Shift colors : cycle colors and change colorness (saturation)
Complementary colors : use complementary colors without changing the lightness
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

Selection
Selection is composed with rectangles, ellipses, polygons, magic wand and pen drawing.
It contains levels of transparency, so that the border of an elliptic region has antialiasing.
With the left button you can add elements to the selection, and with the right button, you can remove elements from it.
The rotation tool allows to rotate the current selection with a free angle.
Selection fit option reduces the selection to non transparent pixels.                                                                                       
DPI Aware
LazPaint looks the same on high DPI resolutions. It works as well on Retina display and is aware of dark theme. One can change switch to dark theme manually as well.

Languages
LazPaint is available in the following languages : Arabic, Bulgarian, Chinese, Czech, Dutch, German, English, French, Finnish, Japanese, Kabyle, Latvian, Portuguese, Russian, Spanish and Swedish

Filters
Radial blur : non directional blur
Motion blur : directional blur
Custom blur : blur according to a mask
Pixelate : fake big pixels
Sharpen : makes contours more accute, complementary to Smooth
Smooth : softens whole image, complementary to Sharpen
Noise : draw random colors and intensities
Median : computes the median of colors around each pixel, which softens corners
ClearType : add a ClearType effect (displacement of RGB channels)
Inverse ClearType : remove a ClearType effect (displacement of RGB channels)
Contour : draws contours on a white background (like a pencil drawing)
Emboss : draws contours with shadow
Shaded map : draw lightened/shaded map use the image as a map of altitudes
Sphere : spherical projection
Twirl : twirl distortion (like water flowing in hole)
Cylinder : cylinder projection

Command line
LazPaint can be used from the command line to perform a variety of tasks.
From converting one image to another, creating a new image from sctratch, or applying filters to an image.
Following is a list of some of its commands.....

General Commands

HorizontalFlip,  VerticalFlip,  SwapRedBlue,  RotateCW
RotateCCW,  Resample,  Opacity,  Gradient,  New

Filter commands

You can apply filters with default values.
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
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on February 06, 2011, 05:23:25 am
Very nice circular !
this is already better than mspaint !

if i can suggest you for the next steps:
- add select tool
- filters apply only on selection
- a script language for custom filters (pascal script or lua) (or be able to use Gimp ones
- filename in titlebar + multiple images open in tabs?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: benohb on February 06, 2011, 07:28:44 am
I was trying to make a similar program :D :D
the Library "bgrabitmap" in ubuntu is slow ..."rather"

# notice
You can change the place of drawing in the window

In the example with the library Unit1.pas / line 274

Code: [Select]
Bmp.Draw(Canvas,rect(0,0,ClientWidth,ClientHeight),True);

0,0 is The beginning of the drawing in the window


# notice2

Can not compile your program linux :'( :'(
I think the problem  in "bgrabitmap"

Thank you
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 06, 2011, 10:13:28 am
Very nice circular !
this is already better than mspaint !

if i can suggest you for the next steps:
- add select tool
- filters apply only on selection
- a script language for custom filters (pascal script or lua) (or be able to use Gimp ones
- filename in titlebar + multiple images open in tabs?
That's right. I was already thinking about select tool. I would like it to be a kind of mask, with a level from 0 to 255, like a grayscale bitmap.

If you want to do it, you're welcome !  ::)

I was trying to manufacture a similar program :D :D
the Library "bgrabitmap" in ubuntu is slow ..."rather"
I know. If you have an idea to make it faster, it would be welcome.

The filters are also slow, if someone now how to boost them...

Quote
# noting
You can change the place of drawing in the window

In the example with the library Unit1.pas / line 274

Code: [Select]
Bmp.Draw(Canvas,rect(0,0,ClientWidth,ClientHeight),True);

0,0 is The beginning of the drawing in the window
I do not understand.

Quote
# noting2

Can not compile your program linux :'( :'(
I think the problem  in "bgrabitmap"
What error message do you get ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: LazaruX on February 06, 2011, 12:57:35 pm
I tested it for 2 mins only and I think:
Very good project.
Very professional.
Well done
I think with small improvements this could become the new Paint.NET, easier thant GIMP and more powerfull than PBrush.exe
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 06, 2011, 02:17:17 pm
Thank you   :)

There just some issues about slowness. Part of it depends on the freepascal compiler, which does not produce very efficient code, and part of it depends on finding way to implement faster routines (for instance with filters).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 06, 2011, 04:39:52 pm
Quote
Part of it depends on the freepascal compiler, which does not produce very efficient code
Really? How can you say so?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Phil on February 06, 2011, 06:57:25 pm
A number of issues on OS X / Carbon:

- See screenshot. Toolbar is rather messed up.

- Once the Colors dialog comes up, then no matter where I click on toolbar, the Colors dialog comes up again.

- Tools dialogs moves after any dialog is displayed.

- Usual sorts of things that one sees in an app that is not optimized for Mac: two Quit menu commands, wrong shortcuts for things like Undo (Cmd+Z, not Ctrl+Z).

- Is there no copy and paste support? If so, they should have Edit menu commands.

- Seems to be kind of bilingual. Open dialog title is in English, Save dialog title is in French.

Thanks.

-Phil
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 06, 2011, 11:33:39 pm
Quote
Part of it depends on the freepascal compiler, which does not produce very efficient code
Really? How can you say so?
Because I've looked at the generated asm code. For example, with this Pascal code :
Code: Pascal  [Select][+][-]
  1.      p := Data;
  2.      for n := NbPixels-1 downto 0 do  //iteration
  3.      begin
  4.        if p^.alpha <> 0 then
  5.        begin
  6.          p^.red := 255-p^.red;
  7.          p^.green := 255-p^.green;
  8.          p^.blue := 255-p^.blue;
  9.        end;
  10.        //else transparent      
  11.        inc(p);
  12.      end;  
  13.      //endloop
  14.  

It gives an assembly code Which can be interpreted as :

Code: [Select]
mov SELF,rcx            //p := self.Data;
 callq GetDataPtr
 mov rax, P
  
 mov SELF,rax            //n := self.NbPixels-1;
 movslq (rax).NBPIXELS,rax
 dec rax
 mov eax, N
 
 cmpl $00, N             //if n<0 then goto @endloop;
 jl @endloop
 incl N                  //inc(n);
 nop                     //useless
 
 @iteration:
 decl N                  //dec(n);
 
 mov P,rax               //if p^.alpha = 0 then goto @transparent;
 movzbl 0x3(rax),eax
 test rax,rax            //(!) this seems to be wrong, it should test eax
 je @transparent
 
 mov P,rax               //p^.red := 255-p^.red;
 movzbl 0x2(rax),edx
 mov $00000000000000FF,rax
 sub rdx,rax
 mov rax,rdx
 mov P,rax
 mov dl,0x2(rax)
 
 mov P,rax               //p^.green := 255-p^.green;
 movzbl 0x1(rax),edx
 mov $00000000000000FF,rax
 sub rdx,rax
 mov rax,rdx
 mov P,rax
 mov dl,0x1(rax)
 
 mov P,rax               //p^.blue := 255-p^.blue;
 movzbl (rax),edx
 mov $00000000000000FF,rax
 sub rdx,rax
 mov rax,rdx
 mov P,rax
 mov dl,(rax)
 
 @transparent:
 addq $04, P             //inc(p);
 
 cmpl $00, N             //if N > 0 then goto @iteration;
 jg @iteration
 
 @endloop:

 This could be simplified by the compiler in something like :
 
 
Code: [Select]
mov SELF,rcx            //p := self.Data;  
 callq GetDataPtr
 mov rax, rdi            //( p -> rdi )
  
 mov SELF,rax            //n := self.NbPixels-1;
 movslq (rax).NBPIXELS,rdx
 dec rdx                 //( n -> rdx )
 
 js @endloop             //if n<0 then goto @endloop;
  
 xor ecx, ecx
 @iteration:
            
 cmp 0x3(rdi),ecl        //if p^.alpha = 0 then goto @transparent;
 je @transparent
 
 mov P,rax              
 notb 0x2(rdi)           //p^.red := 255-p^.red;
 notb 0x1(rdi)           //p^.green := 255-p^.green;
 notb (rdi)              //p^.blue := 255-p^.blue;
 
 @transparent:
 add $04, rdi            //inc(p);
 
 dec rdx                 //dec(n);
 jns @iteration          //if N >= 0 then goto @iteration;
 
 @endloop:
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 06, 2011, 11:40:13 pm
A number of issues on OS X / Carbon:

- See screenshot. Toolbar is rather messed up.
You're right. On Windows too, there are some problems with toolbars, elements get scrambled. But, I wonder what I can do about it. Programming the toolbar myself ?

Quote
- Once the Colors dialog comes up, then no matter where I click on toolbar, the Colors dialog comes up again.
Maybe some other bug with the interface. I guess I cannot do anything about it except by programming it myself.

Quote
- Tools dialogs moves after any dialog is displayed.
I don't understand.

Quote
- Usual sorts of things that one sees in an app that is not optimized for Mac: two Quit menu commands, wrong shortcuts for things like Undo (Cmd+Z, not Ctrl+Z).
Ok. What method do you suggest to fix it ?

Quote
- Is there no copy and paste support? If so, they should have Edit menu commands.
Not yet.

Quote
- Seems to be kind of bilingual. Open dialog title is in English, Save dialog title is in French.
Ok I fixed it.

Phil, what about the drawing, is it slow or fast ? Is the rendering correct ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Phil on February 06, 2011, 11:43:05 pm
You can look at some of this for ideas about how to optimize it for Mac:

http://web.me.com/macpgmr/ObjP/MacXPlatform_Part8.html


When I reposition to Tools dialog, then bring up, say, Open dialog (which hides Tools dialog, it appears), then after Open is dismissed, the Tools dialog moves back to some other position instead of the position I moved it to.

I haven't looked at it beyond just the UI.

Thanks.

-Phil
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 07, 2011, 12:02:00 am
When I reposition to Tools dialog, then bring up, say, Open dialog (which hides Tools dialog, it appears), then after Open is dismissed, the Tools dialog moves back to some other position instead of the position I moved it to.
Ok. I fixed it.

Quote
I haven't looked at it beyond just the UI.
Not even click once on the drawing area ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 07, 2011, 03:32:59 am
Quote
This could be simplified by the compiler in something like
Looks like an ASMCSE optimization case. Have you enabled that? (not sure about the stability state, but AFAIK it's enabled in -O3 and I've used it and so far no trouble yet, at least in recent version).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: wOvAN on February 07, 2011, 09:54:57 am
A way to avoid flickering.

Code: [Select]
procedure WMEraseBkgnd(var Message: TLMEraseBkgnd); message LM_ERASEBKGND;
.......
implementation

.......

procedure TFMain.WMEraseBkgnd(var Message: TLMEraseBkgnd);
begin
   //  block Erasing background
   //  inherited EraseBackground(DC);
end;     
                                               

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: LazaruX on February 07, 2011, 10:07:38 am
Quote
Part of it depends on the freepascal compiler, which does not produce very efficient code
Really? How can you say so?
Because I've looked at the generated asm code. For example, with this Pascal code :
Code: Pascal  [Select][+][-]
  1.      p := Data;
  2.      for n := NbPixels-1 downto 0 do  //iteration
  3.      begin
  4.        if p^.alpha <> 0 then
  5.        begin
  6.          p^.red := 255-p^.red;
  7.          p^.green := 255-p^.green;
  8.          p^.blue := 255-p^.blue;
  9.        end;
  10.        //else transparent      
  11.        inc(p);
  12.      end;  
  13.      //endloop
  14.  

It gives an assembly code Which can be interpreted as :

Code: [Select]
mov SELF,rcx            //p := self.Data;
 callq GetDataPtr
 mov rax, P
 
 mov SELF,rax            //n := self.NbPixels-1;
 movslq (rax).NBPIXELS,rax
 dec rax
 mov eax, N
 
 cmpl $00, N             //if n<0 then goto @endloop;
 jl @endloop
 incl N                  //inc(n);
 nop                     //useless
 
 @iteration:
 decl N                  //dec(n);
 
 mov P,rax               //if p^.alpha = 0 then goto @transparent;
 movzbl 0x3(rax),eax
 test rax,rax            //(!) this seems to be wrong, it should test eax
 je @transparent
 
 mov P,rax               //p^.red := 255-p^.red;
 movzbl 0x2(rax),edx
 mov $00000000000000FF,rax
 sub rdx,rax
 mov rax,rdx
 mov P,rax
 mov dl,0x2(rax)
 
 mov P,rax               //p^.green := 255-p^.green;
 movzbl 0x1(rax),edx
 mov $00000000000000FF,rax
 sub rdx,rax
 mov rax,rdx
 mov P,rax
 mov dl,0x1(rax)
 
 mov P,rax               //p^.blue := 255-p^.blue;
 movzbl (rax),edx
 mov $00000000000000FF,rax
 sub rdx,rax
 mov rax,rdx
 mov P,rax
 mov dl,(rax)
 
 @transparent:
 addq $04, P             //inc(p);
 
 cmpl $00, N             //if N > 0 then goto @iteration;
 jg @iteration
 
 @endloop:

 This could be simplified by the compiler in something like :
 
 
Code: [Select]
mov SELF,rcx            //p := self.Data; 
 callq GetDataPtr
 mov rax, rdi            //( p -> rdi )
 
 mov SELF,rax            //n := self.NbPixels-1;
 movslq (rax).NBPIXELS,rdx
 dec rdx                 //( n -> rdx )
 
 js @endloop             //if n<0 then goto @endloop;
 
 xor ecx, ecx
 @iteration:
           
 cmp 0x3(rdi),ecl        //if p^.alpha = 0 then goto @transparent;
 je @transparent
 
 mov P,rax               
 notb 0x2(rdi)           //p^.red := 255-p^.red;
 notb 0x1(rdi)           //p^.green := 255-p^.green;
 notb (rdi)              //p^.blue := 255-p^.blue;
 
 @transparent:
 add $04, rdi            //inc(p);
 
 dec rdx                 //dec(n);
 jnz @iteration          //if N <> 0 then goto @iteration;
 
 @endloop:

Gangsterish ;-)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: felipemdc on February 07, 2011, 11:03:12 am
I just used it and it worked well, but some suggestions:

1> There is no code in the subversion, it should really be developed there

2> No tooltips in the user interface make it hard to guess that items mean. I took some time to figure out what the number near the colors is the alpha. A label near it or a tooltip would help a lot. All buttons and spin controls in the main screen should have tooltips

3> Couldn't compile with the latest Lazarus 0.9.31. I had to apply the following modification:

Code: [Select]
unit BGRAGtkBitmap;

....

uses
....
  {$IFDEF LCLgtk2}
  gdk2, gtk2def, gtk2Proc;
{$ENDIF}
{$IFDEF LCLgtk}
  gdk, gtkdef, gtkProc;
{$ENDIF}
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: benohb on February 08, 2011, 01:06:32 am



Quote
What error message do you get ?

Code: [Select]
bgradefaultbitmap.pas(210,17) Warning: An inherited method is hidden by "TBGRADefaultBitmap.Equals(TBGRADefaultBitmap):Boolean;"
bgragtkbitmap.pas(57,2) Fatal: Can't find unit gtkDef used by BGRAGtkBitmap


This resolves the problem

  gtk2Def, gtk2Proc;


Sorry for the bad language

Thanks for the wonderful program  ::)


Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: mWaltari on February 08, 2011, 06:54:35 am
Hello,

Here is related project, that we have been thinking to port for Lazarus... if anyone is interested to help ;)

IT is going trough pretty heavy refactoring right now, to make future work and porting bit easier project.

http://sourceforge.net/projects/graphicsmagic/

-TP-
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 08, 2011, 10:13:49 am
A way to avoid flickering.
Thanks, it seems to work.

Quote
This could be simplified by the compiler in something like
Looks like an ASMCSE optimization case. Have you enabled that? (not sure about the stability state, but AFAIK it's enabled in -O3 and I've used it and so far no trouble yet, at least in recent version).
Ok, i've activated all optimizations features. That's better.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 08, 2011, 10:26:04 am
Gangsterish ;-)
Nope, that's totally legal...   ;)

1> There is no code in the subversion, it should really be developed there
Really ? On SourceForge, it says that it can be accessed with :
svn co https://lazpaint.svn.sourceforge.net/svnroot/lazpaint lazpaint

I'm working on a local copy, and I publish it when it seems to me ok. I guess it's not the right way. How do you suggest to do that ?

Quote
2> No tooltips in the user interface make it hard to guess that items mean. I took some time to figure out what the number near the colors is the alpha. A label near it or a tooltip would help a lot. All buttons and spin controls in the main screen should have tooltips
Ok. I've added them.

Quote
3> Couldn't compile with the latest Lazarus 0.9.31. I had to apply the following modification:

Code: [Select]
unit BGRAGtkBitmap;

....

uses
....
  {$IFDEF LCLgtk2}
  gdk2, gtk2def, gtk2Proc;
{$ENDIF}
{$IFDEF LCLgtk}
  gdk, gtkdef, gtkProc;
{$ENDIF}
I've done the modifications and uploaded a new version of BGRABitmap on SourceForge.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 08, 2011, 10:45:23 am
Quote
Gangsterish ;-)
If you go to Turbo Pascal or OSDev forum, you'll encounter that more often and that's a normal thing there :P Even some would directly encode the instructions with db/dd/dw.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: felipemdc on February 08, 2011, 03:34:41 pm
Really ? On SourceForge, it says that it can be accessed with :
svn co https://lazpaint.svn.sourceforge.net/svnroot/lazpaint lazpaint

I'm working on a local copy, and I publish it when it seems to me ok. I guess it's not the right way. How do you suggest to do that ?

The usual way is to do it like this:

svn co https://lazpaint.svn.sourceforge.net/svnroot/lazpaint lazpaint

Then put your code inside lazpaint

Then add all your files:

cd lazpaint
svn add *.lpi *.pas *.lfm *.pp

sometimes you need to set the properties of the files too:

svn propset svn:mime-type text/plain *.lpi *.pas *.lfm
svn propset svn:eol-style native *.lpi *.pas *.lfm

Then commit the changes:

svn commit --message "Initial commit of the code"

Then when I do my own checkout I will get your files.

You can also try to google for: subversion tutorial

If you are using Windows, then install TortoiseSVN
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 08, 2011, 09:28:36 pm
Hey folks !

Here is a new version (1.1) with features we have taked about :
- selection (including drawing the selection with a pen)
- cut'n'paste but within the program, I did not find how to access the system clipboard yet
- current tool is shown
- tool tips every where and keyboard shortcuts

https://sourceforge.net/projects/lazpaint/files/lazpaint/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 08, 2011, 09:32:09 pm
Really ? On SourceForge, it says that it can be accessed with :
svn co https://lazpaint.svn.sourceforge.net/svnroot/lazpaint lazpaint

I'm working on a local copy, and I publish it when it seems to me ok. I guess it's not the right way. How do you suggest to do that ?

The usual way is to do it like this:

svn co https://lazpaint.svn.sourceforge.net/svnroot/lazpaint lazpaint

Then put your code inside lazpaint

Then add all your files:

cd lazpaint
svn add *.lpi *.pas *.lfm *.pp

sometimes you need to set the properties of the files too:

svn propset svn:mime-type text/plain *.lpi *.pas *.lfm
svn propset svn:eol-style native *.lpi *.pas *.lfm

Then commit the changes:

svn commit --message "Initial commit of the code"

Then when I do my own checkout I will get your files.

You can also try to google for: subversion tutorial

If you are using Windows, then install TortoiseSVN

Ok, I understand. It will be like a common folder with the current version, so it is not linked with the files folder of SouceForge that we can access through the the website, right ?

I have commited the version 1.1.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 09, 2011, 07:30:00 pm
You can look at some of this for ideas about how to optimize it for Mac:

http://web.me.com/macpgmr/ObjP/MacXPlatform_Part8.html
I have worked on the toolbar issue. In the next version, it should be better.

I have tried my app on some Linux system, and the toolbox would not stay on top. Yet the property is well defined. Why ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: nisses on February 09, 2011, 11:31:47 pm
I tried it on Windows 7 with 64-bits CPU, but it should work on 32-bits and on Linux.

Impressive.  BTW I tested it on 32bit XP SP3. Compiles and works fine in Laz 0.9.28.2.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 10, 2011, 01:56:55 am
Cool.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 10, 2011, 05:54:46 pm
Here is a new version 1.3, with some improvements :


I added new screenshots :
https://sourceforge.net/projects/lazpaint/

Phil, can you tell me if it renders correctly on Mac OS?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 10, 2011, 06:37:19 pm
Quote
Here is a new version 1.3, with some improvements
Damn, you move too fast. I haven't even got a chance to try 1.1 :P
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 10, 2011, 08:05:43 pm
lol well in fact version 1.2 does not exist, it was just to make same version number for BGRABitmap and LazPaint  ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 10, 2011, 09:40:10 pm

Here is the mac render screenshot. (Mac OS X 10.5.8)
1. Crosshair is disappear in the image drawing zone.
2. Something wrong with the OnPaint event, cos drawing on the canvas nothing happens after changing the form size it appears.
3. Zoom in and out arent working.
4. Close can be added to the File menu.
I havent tested all of the things but some of the problem mentioned above.
Here are some opinions about the application.
1. Tools form should be closed and visibility of Tools can be add to the Edit menu or something else.
2. Information of the x, y points and other related things can be shown at the StatusBar (TStatusBar)
Thanks, great job by the way.

P.S. Here I compiled on the Ubuntu 10.10 and crosshair is so slow.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 10, 2011, 11:06:32 pm
Here is the mac render screenshot. (Mac OS X 10.5.8)
Thanks.

Quote
1. Crosshair is disappear in the image drawing zone.
P.S. Here I compiled on the Ubuntu 10.10 and crosshair is so slow.
Ok so I should give up with this way of doing the crosshair. I can use a normal cursor, but I do not know how to redefine it. There is a standard crosshair cursor, but it is using inverted pixels, so it is not visible on gray (127 xor 255 = 128). I would like to use a cross hair with black and white. Problem is how to embed it into the exe file and use it inside the application.

Quote
2. Something wrong with the OnPaint event, cos drawing on the canvas nothing happens after changing the form size it appears.
Do you mean that while you are drawing, you do not see anything, and the drawing shows up only after you resize the form ? If so, then it explains why you don't see the crosshair. It is painted in the picture like a standard drawing. But I don't understand why this happens.

Quote
3. Zoom in and out arent working.
I suppose it's the same problem. Maybe it is because direct drawing on Canvas is not possible. In this case, I should put a Repaint even each time the image is drawn.

Quote
4. Close can be added to the File menu.
Ok.

Quote
1. Tools form should be closed and visibility of Tools can be add to the Edit menu or something else.
I do not understand. How could the user choose the current tool ? The toolbox is the most convenient way.

Quote
2. Information of the x, y points and other related things can be shown at the StatusBar (TStatusBar)
Good idea.

Quote
Thanks, great job by the way.
Thank you, but I wonder what you have seen if it's not painted when you draw...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 10, 2011, 11:41:23 pm
IndianaJones, here is a new version (1.3b) designed to fix the problems you've mentionned. Can you give it a try ?

https://sourceforge.net/projects/lazpaint/files/lazpaint/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 11, 2011, 03:02:06 am

For the first question;
1. create the icon using any icon editor, painter...
2. convert ico file with using lazres. (resource file) which is in the /lazarus/tools directory.
3. http://wiki.lazarus.freepascal.org/Lazarus_Resources (http://wiki.lazarus.freepascal.org/Lazarus_Resources) for the usage of the lazres.
4. add the lrs file to the initialization section.
5. try the following code.
Code: [Select]
var
  ico : TPicture;
begin
  ico:= TPicture.Create;
  ico.LoadFromLazarusResource('wi0126-32');
  Screen.Cursors[5] := ico.Icon.Handle;
//  Screen.Cursor:=5;
  Form1.Cursor:=5;
6. 'wi0126-32' is my icon file name in the resource file.
 
2. Right
3. Right

Quote
I do not understand. How could the user choose the current tool ? The toolbox is the most convenient way.
I mean just add in the menu (shortcut) to close and open the tool window.

Quote
Thank you, but I wonder what you have seen if it's not painted when you draw...
Things can be improved man. :)

So the last thing, I am going to test the new version later. (here four oclock in the morning)  %)
Thanks.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 11, 2011, 01:48:29 pm
Thanks for these explanations. It seems works on Win64.  :)

I mean just add in the menu (shortcut) to close and open the tool window.
Ok.

Quote
Quote
Thank you, but I wonder what you have seen if it's not painted when you draw...
Things can be improved man. :)
I hope so.  ::)

Quote
So the last thing, I am going to test the new version later. (here four oclock in the morning)  %)
How come ? That's very late.  %)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 11, 2011, 03:41:19 pm
@circular, it works perfetto, congratulations.
Here is some modifications:
1. Clear the area can be added.
2. There is something wrong with the pen color. For example, when I select the pen color to blue(255) and drawing a rectangle which is red(?).
3. Color Dialog can be open like Tools menu, as attached image.
4. Minimizing the application to maximization doesnt work.
5. Floodfill doesnt work well. (sometimes it fills sometimes doesnt)
I will add some other related modifications later.
Thanks.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 11, 2011, 06:44:42 pm
1. Clear the area can be added.
What do you mean ? Clear the whole bitmap, or clear the selected area ?
To clear the bitmap, you can do File>New, and to clear an area, select and Edit>Cut.

Quote
2. There is something wrong with the pen color. For example, when I select the pen color to blue(255) and drawing a rectangle which is red(?).
It is possible that red and blue channels are swapped. In this case :
blue becomes red
green stays green
red becomes blue
yellow becomes cyan
white stays white

Is it the case ?

Quote
3. Color Dialog can be open like Tools menu, as attached image.
You mean a permanent window to choose a color ? Good idea.

Quote
4. Minimizing the application to maximization doesnt work.
What happens ?

Quote
5. Floodfill doesnt work well. (sometimes it fills sometimes doesnt)
Strange. Because of the selection ?

Quote
Thanks.
Thank you too.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 11, 2011, 07:09:36 pm
Here is a new version (1.4) with :


https://sourceforge.net/projects/lazpaint/files/lazpaint/
 8-)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Blaazen on February 11, 2011, 07:36:28 pm
Some (probably platform specific) problem here. Linux + KDE (Qt 4.7.1).

Version: 1.4 - ../../../../Lazarus_Qt/lazarus/lcl/menus.pp(454,1) Fatal: Can't find unit Forms used by Menus
   (error on compilig)

Version: 1.3 - when resizing Form or when Save menu item selected from mainMenu then SIGSEGV + Can't find "image/qimage.cpp"
   this version run (problem with crosshair cursor is probably repaired in 1.4)

I don't now why because I use MainMenu, SaveDialog, resizing etc. in my App. and I never saw these bugs before.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 11, 2011, 07:40:57 pm
1.
Quote
What do you mean ? Clear the whole bitmap, or clear the selected area ?
Adding an shortcut to clear the bitmap, and a new for appear for the transparency of the cleared bitmap. (opacity, solid)

2.
Quote
Is it the case.
Yes, it is the case.

3.
Quote
You mean a permanent window to choose a color ? Good idea.
Yep

4.
Quote
What happens ?
After minimazing the application, it doesnt come up to the screen again.

5.
Quote
Strange. Because of the selection ?
No, I think the problem is related with the Tolerance, if the tolerance is bigger than 100, the problem occurs, below it works perfectly.

New cases:
1. Tolerance 0 gives 'Division by zero'
2. In the New window, have a look at the Cancel button.

Thanks.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 11, 2011, 08:06:21 pm
I confirm the problem which is reported by Blaazen.

../../lazarus/lcl/menus.pp(454,1) Fatal: Can't find unit Forms used by Menus

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 11, 2011, 08:28:28 pm
Some (probably platform specific) problem here. Linux + KDE (Qt 4.7.1).

Version: 1.4 - ../../../../Lazarus_Qt/lazarus/lcl/menus.pp(454,1) Fatal: Can't find unit Forms used by Menus
   (error on compilig)

Version: 1.3 - when resizing Form or when Save menu item selected from mainMenu then SIGSEGV + Can't find "image/qimage.cpp"
   this version run (problem with crosshair cursor is probably repaired in 1.4)

I don't now why because I use MainMenu, SaveDialog, resizing etc. in my App. and I never saw these bugs before.
I have no idea what to do about it. Maybe the unit clauses are different with Qt.

By the way, BGRABitmap may not work on Qt, there is only the right code for Windows and Gtk. It would be interesting to test it, and maybe add some specific directives and functions to ensure BGRA drawing.

1.
Quote
What do you mean ? Clear the whole bitmap, or clear the selected area ?
Adding an shortcut to clear the bitmap, and a new for appear for the transparency of the cleared bitmap. (opacity, solid)
I do not understand.

Quote
Yes, it is the case.
So there is a Red/Blue inversion. Can you try to replace the following function :
Code: Pascal  [Select][+][-]
  1. procedure TBGRAGtkBitmap.DataDrawOpaque(ACanvas: TCanvas; Rect: TRect;
  2.   AData: Pointer; ALineOrder: TRawImageLineOrder; AWidth, AHeight: integer);
  3. var Temp: TBitmap; RawImage: TRawImage; BitmapHandle, MaskHandle: HBitmap; CreateSuccess: Boolean;
  4. begin
  5.      if (AHeight=0) or (AWidth = 0) then exit;
  6.  
  7.      RawImage.Init;
  8.      {$IFDEF DARWIN}
  9.      RawImage.Description.Init_BPP32_R8G8B8_BIO_TTB(AWidth,AHeight);
  10.      SwapRedBlue;
  11.      {$ELSE}
  12.      RawImage.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth,AHeight);
  13.      {$ENDIF}
  14.      RawImage.Description.LineOrder:= ALineOrder;
  15.      RawImage.Description.LineEnd := rileDWordBoundary;
  16.      RawImage.Data:= PByte(AData);
  17.      RawImage.DataSize:= AWidth*AHeight*Sizeof(TBGRAPixel);
  18.      CreateSuccess := RawImage_CreateBitmaps(RawImage, BitmapHandle, MaskHandle, false);
  19.      {$IFDEF DARWIN}
  20.      SwapRedBlue;
  21.      {$ENDIF}
  22.      if not CreateSuccess then
  23.        raise FPImageException.Create('Failed to create bitmap handle');
  24.      Temp := TBitmap.Create;
  25.      Temp.Handle := BitmapHandle;
  26.      Temp.MaskHandle := MaskHandle;
  27.      ACanvas.StretchDraw(Rect,Temp);
  28.      Temp.Free;
  29. end;  


Quote
Quote
What happens ?
After minimazing the application, it doesnt come up to the screen again.
What happens if you try to debug it at this precise moment ?

Quote
No, I think the problem is related with the Tolerance, if the tolerance is bigger than 100, the problem occurs, below it works perfectly.
Ok. I think it is not a bug. The progressive floodfill has a transparency. When tolerance is big, many pixels are filled but with transparency so you may not notice it, all you see is that it paints multiple parts at the same time.

Quote
1. Tolerance 0 gives 'Division by zero'
Ok. I got this problem too. I'm fixing it.

Quote
2. In the New window, have a look at the Cancel button.
There is no problem here with this button.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Sternas Stefanos on February 12, 2011, 07:49:19 am
BGRABitmap working OK
and to Windows Mobile 6.5.3 WVGA (800x480)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DelphiFreak on February 12, 2011, 08:02:54 am
Hello,

I suddenly can not compile the project anymore. LazPaint revision 10.

Always get: E:\lazarus\lcl\menus.pp(454,1) Fatal: Can't find unit Forms used by Menus

Lazarus 0.9.31 r29477 FPC 2.4.3 i386-win32-win32/win64

Just tested. revision 7 compiled. revision 8 does not.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 12, 2011, 11:47:52 am
Hello,

I suddenly can not compile the project anymore. LazPaint revision 10.

Always get: E:\lazarus\lcl\menus.pp(454,1) Fatal: Can't find unit Forms used by Menus

Lazarus 0.9.31 r29477 FPC 2.4.3 i386-win32-win32/win64

Just tested. revision 7 compiled. revision 8 does not.
Ok. How can I know the differences between revision 7 and revision 8 ?

Note : I'm using TortoiseSVN.

EDIT : I found how to compare revisions. I'm looking for a significative difference.

I do not understand what could be causing this. There is no modifications about Forms or Menus. I guess it is a problem of directories. The only significative change is that I added custom cursors. If you strip ucursors in the last version, what happens ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 12, 2011, 02:10:33 pm
Here a new version (1.5) :
https://sourceforge.net/projects/lazpaint/files/lazpaint/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 12, 2011, 11:41:49 pm
Quote
I do not understand what could be causing this. There is no modifications about Forms or Menus. I guess it is a problem of directories. The only significative change is that I added custom cursors. If you strip ucursors in the last version, what happens ?
The error comes from cursors.lrs which is used by LCL Forms unit as well (different cursor.lrs, of course). Renaming it to something else should fix it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 13, 2011, 03:08:54 am
Ok. I've changed it on subversion. Does it work ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DelphiFreak on February 13, 2011, 05:20:59 pm
Yes, it works now. Thank you.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 13, 2011, 10:13:17 pm
Thank you for the confirmation, I am putting this new version on Sourceforge as a zip file.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 13, 2011, 11:50:43 pm
Hey people !

I've managed to make LazPaint load Paint.NET images. The layers are flattened, because LazPaint cannot edit layered images... yet.

By the way, to do so, I had to write a unit to read binary serialized .Net objects. If someone is interested by this, it's the unit udnetdeserial (Unit DotNet Deserialization).

Image data in Paint.NET files are compressed with gzip, so I used the zstream unit. The file format is a little bit different, so I just skip the 10 bytes of GZip header and use deflate without header (Tdecompressionstream with skipheader option).

As usual, it can be downloaded here (version 1.6) :
https://sourceforge.net/projects/lazpaint/files/lazpaint/

I've added some documentation on Lazarus wiki (in French  8)) :
http://wiki.lazarus.freepascal.org/BGRABitmap/fr
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 14, 2011, 04:16:51 pm
@circular, sorry for the late response.
I compiled the last svn wuthout problem except umac unit needs to be replaced like this (cos it gives compiler error.)procedure

CheckSpinEdit(SpinEdit: TSpinEdit);
begin
   {$IFDEF DARWIN}
   SpinEdit.Left:=SpinEdit.Left+3;
   SpinEdit.Top:=SpinEdit.Top+3;
//   SpinEdit.Left += 3;
//   SpinEdit.Top += 3;
   {$ENDIF}
end;

Some modifications can be added:
1. Color windows shows the correct color but pen color(Shape_PenColor) does not.
2. Especially for mac, minimizing the main form doesnt minimize the others (color window, tools window)
3. New window renders wrongly which is attached.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 14, 2011, 04:56:22 pm
Thank you, I will take this into account.

Quote
1. Color windows shows the correct color but pen color(Shape_PenColor) does not.
Can you explain a little more ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 14, 2011, 06:39:31 pm

Quote
Can you explain a little more ?
When you select the red color in 'color window', it reflects to Shape_PenColor as blue.
I hope I can figure it out.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 15, 2011, 12:39:55 am
I wonder if it was not a mistake to swap red and blue for drawing bitmaps. How do the colorcircle look like ? It should be red on the right, blue on the top left and green on the bottom left.

If it is blue on the right, red on the top left and green on the bottom left then it is not correct.

Maybe the encoding of TColor is different because of Low Endiang/Big Endian.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 15, 2011, 11:05:43 am

Here is the screenshot of the colorcircle in mac,it looks like this.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 15, 2011, 01:20:47 pm
Ok, that's not correct. red and blue are swapped.

If you delete the swapping in DataDrawOpaque in BGRAGtkBitmap, what happens ? To do change, remove
Code: Pascal  [Select][+][-]
  1. {$IFDEF DARWIN}
  2.      RawImage.Description.Init_BPP32_R8G8B8_BIO_TTB(AWidth,AHeight);
  3.      SwapRedBlue;
  4. {$ELSE}
  5.  
and remove
Code: Pascal  [Select][+][-]
  1.      {$IFDEF DARWIN}
  2.      SwapRedBlue;
  3.      {$ENDIF}    
  4.  
and the remaining {$ENDIF}

Here is the expected screenshot.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 15, 2011, 02:11:30 pm

Are you sure about the unit?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 15, 2011, 06:14:27 pm
What do you mean ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 15, 2011, 06:36:10 pm

I havent seen a unit like BGRAGtkBitmap in svn 13.
I have searched all the files and there is just an 2 {$IFDEF DARWIN} statement in the umac.pas
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 15, 2011, 09:44:27 pm
Yes, there is. It is in the folder https://lazpaint.svn.sourceforge.net/svnroot/lazpaint/bgrabitmap/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 15, 2011, 10:27:01 pm

Upps, I overlooked the file. Here is the changes.

//     {$IFDEF DARWIN}
//     RawImage.Description.Init_BPP32_R8G8B8_BIO_TTB(AWidth,AHeight);
//     SwapRedBlue;
//     {$ELSE}
     RawImage.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth,AHeight);
//     {$ENDIF}
     RawImage.Description.LineOrder:= ALineOrder;
     RawImage.Description.LineEnd := rileDWordBoundary;
     RawImage.Data:= PByte(AData);
     RawImage.DataSize:= AWidth*AHeight*Sizeof(TBGRAPixel);
     CreateSuccess := RawImage_CreateBitmaps(RawImage, BitmapHandle, MaskHandle, false);
//     {$IFDEF DARWIN}
//     SwapRedBlue;
//     {$ENDIF}

And here is the result.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 16, 2011, 01:01:21 am
It does not make sense. The header is correct, and the generation of the color circle does not goes through a TColor type. So there is no inversion in LazPaint code. So I suppose the error is in the Lazarus code or Freepascal code. We can fix it in LazPaint by swapping Red/Blue without changing headers, we will obtain the right result, but it is a trick. If the Freepascal code is corrected, it will be swapped again. In the meantime, can you try this:

     {$IFDEF DARWIN}
     SwapRedBlue;
     {$ENDIF}

     RawImage.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth,AHeight);
     RawImage.Description.LineOrder:= ALineOrder;
     RawImage.Description.LineEnd := rileDWordBoundary;
     RawImage.Data:= PByte(AData);
     RawImage.DataSize:= AWidth*AHeight*Sizeof(TBGRAPixel);
     CreateSuccess := RawImage_CreateBitmaps(RawImage, BitmapHandle, MaskHandle, false);

     {$IFDEF DARWIN}
     SwapRedBlue;
     {$ENDIF}

Note: there is another problem with the background color. In uchoosecolor.pas, in the procedure FormCreate, there are two lines to determine the colors of the text and of the background :

   FormBackgroundColor := ColorToBGRA(ColorToRGB(self.Color));
   FormTextColor := ColorToBGRA(ColorToRGB(clWindowText));

It seems that this does not work on Mac. Can you try this instead?

   FormBackgroundColor := ColorToBGRA(ColorToRGB(clBtnFace));
   FormTextColor := ColorToBGRA(ColorToRGB(clWindowText));
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 16, 2011, 04:48:41 pm
For the first changes, but the effect is same. (output is the same as the previous one.)
     if (AHeight=0) or (AWidth = 0) then exit;

     RawImage.Init;
     {$IFDEF DARWIN}
     SwapRedBlue;
     {$ENDIF}

          RawImage.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth,AHeight);
          RawImage.Description.LineOrder:= ALineOrder;
          RawImage.Description.LineEnd := rileDWordBoundary;
          RawImage.Data:= PByte(AData);
          RawImage.DataSize:= AWidth*AHeight*Sizeof(TBGRAPixel);
          CreateSuccess := RawImage_CreateBitmaps(RawImage, BitmapHandle, MaskHandle, false);

     {$IFDEF DARWIN}
     SwapRedBlue;
     {$ENDIF}

     if not CreateSuccess then ...
----------------------------------------------------------------------------------------------------
And the second is correct, that can be changed as you suggested.
   FormBackgroundColor := ColorToBGRA(ColorToRGB(clBtnFace));
   FormTextColor := ColorToBGRA(ColorToRGB(clWindowText));            

For the first case, I tested with the original TColorDialog on the mac and the result is correct. I mean the colors are the correct positions.

Here is the trick point maybe this can be show the way.
In the first screenshot (screenshot1) the red picked from the Color Window, but blue is shown. (I pointed with the red circle)
In the second screenshot (screenshot2) the blue picked from the Color Window, but red is shown. (I pointed out with the red circle)
Thanks.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 16, 2011, 09:27:57 pm
For the first changes, but the effect is same. (output is the same as the previous one.)
     if (AHeight=0) or (AWidth = 0) then exit;

     RawImage.Init;
     {$IFDEF DARWIN}
     SwapRedBlue;
     {$ENDIF}

          RawImage.Description.Init_BPP32_B8G8R8_BIO_TTB(AWidth,AHeight);
          RawImage.Description.LineOrder:= ALineOrder;
          RawImage.Description.LineEnd := rileDWordBoundary;
          RawImage.Data:= PByte(AData);
          RawImage.DataSize:= AWidth*AHeight*Sizeof(TBGRAPixel);
          CreateSuccess := RawImage_CreateBitmaps(RawImage, BitmapHandle, MaskHandle, false);

     {$IFDEF DARWIN}
     SwapRedBlue;
     {$ENDIF}

That's not possible. Maybe the compilation is not complete. When you run the project, do a "rebuild all" or something like this. It is the item after normal build (Ctrl-F9). Can you try commenting or decommenting the SwapRedBlue line, rebuild everything and launch the program?

Quote
Here is the trick point maybe this can be show the way.
In the first screenshot (screenshot1) the red picked from the Color Window, but blue is shown. (I pointed with the red circle)
In the second screenshot (screenshot2) the blue picked from the Color Window, but red is shown. (I pointed out with the red circle)
In this cas, clearly the color circle is red-blue swapped.

Thanks.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 16, 2011, 11:02:13 pm
I've updated the English help for LazPaint and BGRABitmap :
http://wiki.lazarus.freepascal.org/LazPaint
http://wiki.lazarus.freepascal.org/BGRABitmap
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 16, 2011, 11:06:47 pm
I rebuild the application with Build All, but there is no difference. So I think BGRAGtkBitmap is not interpreted because of the $(LCLWidgetType) in the BGRABitmap unit.
In this unit there are the following statements but carbon is missing or BGRADefaultBitmap is interpreted not BGRAGtkBitmap.
That could be the problem or may be I am wrong with looking at the source code.
P.S. I am using Mac OS X (Carbon widgetset)

{$IFDEF LCLwin32}
  BGRAWinBitmap
{$ELSE}
  {$IFDEF LCLgtk}
   BGRAGtkBitmap
  {$ELSE}
    {$IFDEF LCLgtk2}
     BGRAGtkBitmap
    {$ELSE}
     BGRADefaultBitmap
    {$ENDIF}
  {$ENDIF}
{$ENDIF}                   
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 16, 2011, 11:33:47 pm
You're right. If it's not using Gtk, the it swaps to default implementation.

I have done new changes. You can download it on subversion. Does it work ?

It is possible to make a special unit for carbon, in order to make it faster. Problem is I can't do it myself because I do not have carbon.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 17, 2011, 12:29:38 pm

I have tested the latest svn 15, and get the following error while compiling.

/lazpaint/bgrabitmap/bgradefaultbitmap.pas(3118,27) Error: identifier idents no member "Init_BPP24_R8G8B8_BIO_TTB"
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 17, 2011, 05:06:17 pm
Ok. So let's do the swap manually.

Can you try with the new version ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 17, 2011, 08:40:23 pm
I have tested with the new svn 16, and it works now also "New Image" window renders ok.
P.S. Hide/Unhide can be added to the Tools and Color windows.
Good work.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 17, 2011, 09:39:22 pm
Cool. Thank you.

About hiding tools and color window, it is possible with the menu View.

What about blur windows (in Filter menu) ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 18, 2011, 01:28:28 am
Here is a new version (1.7)
- renders correctly on MacOS
- added two filters : sphere and cylinder
- added "crop to selection" in Image menu

https://sourceforge.net/projects/lazpaint/files/lazpaint/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 18, 2011, 12:46:18 pm
Quote
What about blur windows (in Filter menu) ?
It would be superb.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DelphiFreak on February 18, 2011, 01:03:03 pm
Hello Circular,

I wanted to debug into the Blur methods but it does not stop when I set the breakpoints.
How to do this?

I did once a little performance optimization.

The optimizations is based on the following theory:
A) to "get" a pixel is faster the "set" a pixel.
B) a black pixel can not get darker than black.

So this means from a performance point of view, it make sense to only calculate blur for pixels which are not already black.
 
http://www.cabiatl.com/mricro/bounty/

Regards,
Sam

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 18, 2011, 03:24:34 pm
Quote
What about blur windows (in Filter menu) ?
It would be superb.
It is already there. I was asking if it works on Mac OS.

Hello Circular,

I wanted to debug into the Blur methods but it does not stop when I set the breakpoints.
Maybe it is in compiler options (code optimizations and link options may disturb debugger).

Quote
I did once a little performance optimization.

The optimizations is based on the following theory:
A) to "get" a pixel is faster the "set" a pixel.
B) a black pixel can not get darker than black.

So this means from a performance point of view, it make sense to only calculate blur for pixels which are not already black.
What changes do you propose exactly ? Can you post here the resulting code ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 18, 2011, 05:54:36 pm
Hi folks.

Here is a new version ( 1.8 ) with :
- rotate 90°
- GPL license for LazPaint, LGPL for BGRABitmap
- embedded Paint.NET files reading in BGRABitmap (so it's LGPL)
- clouds rendering
- autoshow grid
- set canvas size
- selection fit
- remove transparency menu

https://sourceforge.net/projects/lazpaint/files/lazpaint/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 20, 2011, 01:22:13 am
And another new version 1.9 with :
- hue support (colorize, colorshift)
- lightness and intensity of colors
- gif and ico loading
- normalize each channel and with gamma correction

https://sourceforge.net/projects/lazpaint/files/lazpaint/

I guess this version is quite complete. Maybe I'll add some other features (magic wand, sin gradient and effects like a pen). I'm looking for people to make binaries on different platforms. I can do it for Win64.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DelphiFreak on February 20, 2011, 05:55:07 am
Hi,

But to make it a "complete" product, I suggest to add the following features:

- Recent Files list. (displays the latest files used in LazPaint)
- an About-Dialog with Information about LazPaint (Autor,VersionNo,Link to Homepage,Libraries used)

And very important:
- an "Self-Test" command line parameter. e.g. c:\lazpaint -selftest.
This "Self-Test" feature should do the following:

1.) load a test picture.
2.) call each filter function once.
3.) measure the execution time of each filter function. e.g. gettickcount.
4.) call other image manipulation functions to check e.g. rotate, paint a box ...
5.) save the final image together with a little log-file about version,computername,execution time of the filters into a file with name "yyyymmdd_HHMMSS_LazPaint_Selftest.txt"

This self-test feature would be very helpfull for:

  - people who build the executables for the different platforms.
  - you to check if LazPaint does not have regressions after you changed something.

If you provide such I Self-Test feature, I will provide the win32 executables for LazPaint.

By the way:
I recommend you to let the files in folder "bgrabitmap" go through the "Tools"->"JEDI Code Format".

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 20, 2011, 03:52:29 pm
I understand. I will take this into accout.

I asked you about the optimization you were proposing before. Did you notice ?

Another thing I was asking about, if someone know how to read and write to the clipboard, I would be happy to have some explanations. The program uses only an internal clipboard yet.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DelphiFreak on February 20, 2011, 05:14:29 pm
Hello circular,

yes I noticed about your question for optimizations.

Sorry I had not time until now, but now I had just a quick look and as an example I propose this:
Code: [Select]
procedure ErasePixelInline(dest: PBGRAPixel;
  alpha: byte); inline;
var newAlpha: byte;
begin
  newAlpha := dest^.alpha * (255-alpha) div 255;
  if newAlpha = 0 then dest^:= BGRAPixelTransparent else
    dest^.alpha := newAlpha;
end;

In this method a new value for alpha is calculated.
So if dest^.alpha is already 0, then newAlpha will also be 0. There is no need to calculate in this case. It will save you some CPU time.
As I pointed out already, I just had a quick look and I am sure there are more situations like this in your bitmap library.

Another hint: I compiled LazPaint with Compiler switch "Range Check". In this case, LazPaint will fire an "run error 201" in method

Code: [Select]
function ColorToBGRA(color: TColor): TBGRAPixel; overload;
begin
  result.red := color;
  result.green := color shr 8;
  result.blue := color shr 16;
  result.alpha := 255;
end;



Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on February 20, 2011, 05:52:39 pm
I have just tried the new fast release :) and something wrong with the Smart Zoom x3.
After doing 2 times "Smart Zoom x3" and one time "Zoom fit", the applications going into the crazy phase. (not response correctly)

Secondly, Under the Colors menu: revise the Colorize(window position different than the other ones),Shift Colors, Intensity menus, not renders correctly.
Thirdly, After doing Grayscale Tools and Color menus paint themselves again.

P.S. Hide/Unhide looks good.  :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 20, 2011, 08:10:39 pm
I don't know, is it just me or do I really start seeing another PhotoShop / GIMP alternative but with Paint(.NET) easy drawing capabilities? You're nuts, circular! :P
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 20, 2011, 10:31:21 pm
In this method a new value for alpha is calculated.
So if dest^.alpha is already 0, then newAlpha will also be 0. There is no need to calculate in this case. It will save you some CPU time.
I understand. Well, maybe I'll try to optimize the program, but it's not in my priorities, except of course things that do really slow the program in a normal use.

Quote
Another hint: I compiled LazPaint with Compiler switch "Range Check". In this case, LazPaint will fire an "run error 201" in method

Code: [Select]
function ColorToBGRA(color: TColor): TBGRAPixel; overload;
begin
  result.red := color;
  result.green := color shr 8;
  result.blue := color shr 16;
  result.alpha := 255;
end;
That's right, and it's on purpose. I wanted to avoid the "and 255".

I don't know, is it just me or do I really start seeing another PhotoShop / GIMP alternative but with Paint(.NET) easy drawing capabilities? You're nuts, circular! :P
Thanks !   :D

I have just tried the new fast release :) and something wrong with the Smart Zoom x3.
After doing 2 times "Smart Zoom x3" and one time "Zoom fit", the applications going into the crazy phase. (not response correctly)
Hmm... I could not reproduce this problem. Which size is the image at the beggining ?

Quote
Secondly, Under the Colors menu: revise the Colorize(window position different than the other ones)
Ok.

Quote
Shift Colors, Intensity menus, not renders correctly.
Can you send a screenshot ?

Quote
Thirdly, After doing Grayscale Tools and Color menus paint themselves again.
What do you mean?

Quote
P.S. Hide/Unhide looks good.  :D
Cool
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: José Mejuto on February 21, 2011, 10:11:16 am
Quote
Another hint: I compiled LazPaint with Compiler switch "Range Check". In this case, LazPaint will fire an "run error 201" in method
Code: [Select]
function ColorToBGRA(color: TColor): TBGRAPixel; overload;
begin
  result.red := color;
  result.green := color shr 8;
  result.blue := color shr 16;
  result.alpha := 255;
end;
That's right, and it's on purpose. I wanted to avoid the "and 255".

Hello,

So better include it in a range check disable directive:
Code: [Select]
{$PUSH}{$R-}
  result.red := color;
  result.green := color shr 8;
  result.blue := color shr 16;
  result.alpha := 255;
{$POP}
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: panoss on February 21, 2011, 11:17:29 am
I tried Lazpaint in Windows, works perfectly. My congratulations!
But, then i tried in Ubuntu 9.10 (Lazarus 0.9.28.2).
I get the message (/usr/lib/lazarus/0.9.28.2/examples/lazpaint1.9/bgrabitmap/bgragtkbitmap.pas(131,38) Error: Identifier not found "TGtkDeviceContext") trying to install Lazpaint.
The file gtkdevicecontext.inc is in the folder /usr/lib/lazarus/0.9.28.2/lcl/interfaces/gtk.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 21, 2011, 09:03:52 pm
I tried Lazpaint in Windows, works perfectly. My congratulations!
Cool  8)

Quote
But, then i tried in Ubuntu 9.10 (Lazarus 0.9.28.2).
I get the message (/usr/lib/lazarus/0.9.28.2/examples/lazpaint1.9/bgrabitmap/bgragtkbitmap.pas(131,38) Error: Identifier not found "TGtkDeviceContext") trying to install Lazpaint.
I've added some directive on subversion. In fact it should be TGtk2DeviceContext. I guess it's because it's using gtk2 unit, instead of gtk.

I've also noticed the following problems on Gtk2 :
- customized cursors make the program crash
- TopMost windows do not stay on top

So better include it in a range check disable directive:
Code: [Select]
{$PUSH}{$R-}
  result.red := color;
  result.green := color shr 8;
  result.blue := color shr 16;
  result.alpha := 255;
{$POP}
Thanks. It's updated.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 21, 2011, 09:27:13 pm
I've uploaded a new version (2.0) with
- Gtk2DeviceContext fix
- mouseloop for ubuntu in colorcircle (to avoid mouse latency)
- ask for saving current file if changed
- about box
- recent files menu
- better multifile handling
- sine gradients

https://sourceforge.net/projects/lazpaint/files/lazpaint/

Despite the Gtk2 fix, the two following problems are not solved :
- customized cursors make the program crash on ubuntu
- TopMost windows do not stay on top on ubuntu

Anyone has an idea to solve this?

On subversion, I've added an external clipboard. It seems to work on Windows, but I do not know if it works on Linux Gtk1, Gtk2 or MacOS.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DelphiFreak on February 22, 2011, 06:04:48 am
Hoi circular,

your progress on LazPaint is incredible! Does your day have more than 24 hours?

I downloaded the sources but it did not compile anymore.
I am using Lazarus Lazarus 0.9.31 r29638 FPC 2.4.3 i386-win32-win32/win64

I had to modify the unit <ucliboard>.

Replaced the line

     
Code: [Select]
result := TBGRABitmap.Create(Stream);
with
     
Code: [Select]
       result := TBGRABitmap.Create;
       result.LoadFromStream(Stream);   
     

Now I can compile the project.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: garlar27 on February 22, 2011, 05:25:20 pm
Look here Clipbrd (http://lazarus-ccr.sourceforge.net/docs/lcl/clipbrd/index.html), may be you'll find something useful.

I used the clipboard for text and images (long time ago, and only for the whole image). What I remember is that you need to register de format you are putting on the ClipBoard as long as de image. Let me take a look and in a couple of days I might bring you some small example (I thought there was one in the wiki but I Could'nt find it).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 22, 2011, 06:12:48 pm
your progress on LazPaint is incredible! Does your day have more than 24 hours?
No, I'm not working full time.

Quote
I had to modify the unit <ucliboard>.

Replaced the line

     
Code: [Select]
result := TBGRABitmap.Create(Stream);
with
     
Code: [Select]
       result := TBGRABitmap.Create;
       result.LoadFromStream(Stream);   
     

Now I can compile the project.
That's right, I forgot to update BGRABitmap, i've added a create shortcut.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on February 22, 2011, 06:29:41 pm
Can I somehow use BGRABitmap to draw PNG glyph with alpha on TSpeedButton? This code:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   bmp := TBGRABitmap.Create('config.png');
  4. end;    
  5.  
  6. procedure TForm1.FormDestroy(Sender: TObject);
  7. begin
  8.  bmp.Free;
  9. end;  
  10.  
  11. procedure TForm1.SpeedButton1Paint(Sender: TObject);
  12. begin
  13.   bmp.Draw(SpeedButton1.Canvas, 1,1, True);
  14. end;      
  15.  
... draw icons with black background (see attachment)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 23, 2011, 05:04:52 pm
Yes, it depends on the last parameter of Draw. Here it is True, which means Opaque. It's faster but of course, it's not what you want if you want transparency.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on February 23, 2011, 06:14:32 pm
Hm, with "False" this same problem
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 23, 2011, 07:25:22 pm
Strange. Can you debug it to see what drawing procedure is called ?

What about :
Code: Pascal  [Select][+][-]
  1. procedure TForm1.SpeedButton1Paint(Sender: TObject);  
  2. begin  
  3.   SpeedButton1.Canvas.Draw(1, 1, bmp.Bitmap);
  4. end;
?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on February 23, 2011, 08:35:20 pm
Now it works... almost. Lazarus GTK have known issue, it don't have alpha drawing. So images on SpeedButton have jagged edges (or this is antialiasing?). I thought that I solve this problem using TBGRABitmap draw, but this same result (see attachment). I don't know why on TBitBtn images looks clear (if GTK have no alpha). I want to get result like on second button.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 23, 2011, 11:03:22 pm
Ok. If you do :
  SpeedButton1.Canvas.Draw(1, 1, bmp.Bitmap); 
it use the bitmap property, it uses standard drawing functions, so there is no alpha blending.

So the right way should be :
  bmp.Draw(SpeedButton1.Canvas, 1,1, False);

When you debug it, go step by step, what procedures are executed on this line ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on February 24, 2011, 12:30:06 am
Quote
#0 PUTIMAGE(0x7ffff7feb3a0, 0, 0, 0x7ffff7fead60, DMDRAWWITHTRANSPARENCY) at ../../components/lazpaint/bgrabitmap/bgradefaultbitmap.pas:3016
#1 SLOWDRAWTRANSPARENT(0x7ffff7fead60, 0x7ffff7fead60, 0x7ffff7e43a40, {LEFT = 1, TOP = 1, RIGHT = 33, BOTTOM = 33, TOPLEFT = {X = 1, Y = 1}, BOTTOMRIGHT = {X = 33, Y = 33}}) at ../../components/lazpaint/bgrabitmap/bgragtkbitmap.pas:80
#2 DRAW(0x7ffff7fead60, 0x7ffff7e43a40, 1, 1, false) at ../../components/lazpaint/bgrabitmap/bgragtkbitmap.pas:110
#3 SPEEDBUTTON1PAINT(0x7ffff7fb6590, 0x7ffff7fb7b70) at unit1.pas:40[/quote

Are you need more details? Go deeper?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 24, 2011, 12:39:17 am
Thank you. You don't need to go deeper here.

It goes into SLOWDRAWTRANSPARENT, this routine is supposed to draw with transparency. So there is a problem here.

Code: Pascal  [Select][+][-]
  1. procedure TBGRAGtkBitmap.SlowDrawTransparent(ABitmap: TBGRADefaultBitmap;
  2.   ACanvas: TCanvas; ARect: TRect);
  3. var
  4.   background, temp: TBGRADefaultBitmap;
  5.   w, h: integer;
  6.  
  7. begin
  8.   w := ARect.Right - ARect.Left;
  9.   h := ARect.Bottom - ARect.Top;
  10.   background := NewBitmap(w, h);
  11.   background.GetImageFromCanvas(ACanvas, ARect.Left, ARect.Top);
  12.   if (ABitmap.Width = w) and (ABitmap.Height = h) then
  13.     background.PutImage(0, 0, ABitmap, dmDrawWithTransparency)
  14.   else
  15.   begin
  16.     temp := ABitmap.Resample(w, h, rmSimpleStretch);
  17.     background.PutImage(0, 0, temp, dmDrawWithTransparency);
  18.     temp.Free;
  19.   end;
  20.   background.Draw(ACanvas, ARect.Left, ARect.Top, True);
  21.   background.Free;
  22. end;
The background should be initialized to the current background by :
  background.GetImageFromCanvas(ACanvas, ARect.Left, ARect.Top);

Maybe GetImageFromCanvas do not work on a speed button.

What happens if you try to draw your transparent bitmap outside the paint event of the speed button ? And if you draw the image directly on the form instead of the speed button ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on February 24, 2011, 12:56:06 am
This same poblem (attachment). I am using TBGRABitmap from LazPaint 2.0
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DelphiFreak on February 24, 2011, 06:59:22 am
Hello circular,

here is a hint for another little improvement.

Could you please save the settings for Dialog "New Image" so it is available again after the restart of LazPaint?

It's always set to 640*480.

Thank you.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: de_jean_7777 on February 24, 2011, 09:29:54 am
Very impressive program. I just wanted to say that the lazpaint.compiled and lazpaint.res files do not need to be in the svn repository, as they are generated upon compilation.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 24, 2011, 11:13:03 am
This same poblem (attachment). I am using TBGRABitmap from LazPaint 2.0
Ok, so I suppose that GetImageFromCanvas do not work at all on gtk2. You can check this by drawing something on the form with the normal canvas, then call GetImageFromCanvas with a TBGRABitmap, and then draw it (in opaque mode) somewhere else on the form and see if something is copied.

Could you please save the settings for Dialog "New Image" so it is available again after the restart of LazPaint?
Ok. Done.

Very impressive program. I just wanted to say that the lazpaint.compiled and lazpaint.res files do not need to be in the svn repository, as they are generated upon compilation.
Ok, thank you. Done.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on February 24, 2011, 12:49:14 pm
Hey circular,

Would it be easy to implement multiple-file support? (having Tabs?)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 24, 2011, 07:04:40 pm
No, it would need refactoring.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 27, 2011, 03:08:30 pm
Ok, so I've published a new version (2.1) with just two changes:
- deactivated custom cursors on gtk so that it's directly runnable on ubuntu
- added a repeat image feature, usefull when working with textures

https://sourceforge.net/projects/lazpaint/files/lazpaint/

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 28, 2011, 06:55:15 pm
I found how to deal with cursors. In fact, using "ico" format is not the right way  :'(

I've updated on subversion.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DelphiFreak on February 28, 2011, 08:48:40 pm
Sorry, the latest changes break compilation on win32

I get the following message when trying to compile.

windres: can't open file `lazpaint.manifest': No such file or directory
lazpaint.lpr(30,1) Error: Error while compiling resources
lazpaint.lpr(30,1) Fatal: There were 1 errors compiling module, stopping
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 28, 2011, 09:08:01 pm
Strange. Here the manifest is automatically generated. It's just to active themes on XP. What if you do a full compilation ?

Note : i've uploaded again the manifest.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on February 28, 2011, 10:03:12 pm
Strange. Here the manifest is automatically generated. It's just to active themes on XP. What if you do a full compilation ?

Note : i've uploaded again the manifest.

you can add to bgrabitmap or lazpaint some of those gradients? :
http://lazarus.freepascal.org/index.php/topic,12145.0.html

Double Gradient - nGradient
http://wiki.lazarus.freepascal.org/Double_Gradient

Gradient Filler
http://wiki.lazarus.freepascal.org/Gradient_Filler
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DelphiFreak on February 28, 2011, 10:03:22 pm
Ok, now it compiles again. Thank you.

I have added a patch with two improvements:

A) it adds command line support to LazPaint.

Example:
lazpaint <INPUTFILENAME> <FILTERNAME> <OUTPUTFILENAME>

lazpaint "c:\pictures\mypicture1.jpg" pfContour "c:\pictures\newpicture.jpg"

B) reduced the number of Global-Dialogs. Some Dialogs are created only if they are really needed and not in general at application startup.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 01, 2011, 01:43:24 am
you can add to bgrabitmap or lazpaint some of those gradients? :
http://lazarus.freepascal.org/index.php/topic,12145.0.html

Double Gradient - nGradient
http://wiki.lazarus.freepascal.org/Double_Gradient

Gradient Filler
http://wiki.lazarus.freepascal.org/Gradient_Filler

The procedure GradientFill that makes gradients (linear, diamond, radial) in a bounding rectangle. I guess you can combine multiple calls to make those gradients. If you write a procedure for this, I can add it easily.

DelphiFreak i've taken your patch into account.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on March 01, 2011, 01:50:34 am
you can add to bgrabitmap or lazpaint some of those gradients? :
http://lazarus.freepascal.org/index.php/topic,12145.0.html

Double Gradient - nGradient
http://wiki.lazarus.freepascal.org/Double_Gradient

Gradient Filler
http://wiki.lazarus.freepascal.org/Gradient_Filler

The procedure GradientFill that makes gradients (linear, diamond, radial) in a bounding rectangle. I guess you can combine multiple calls to make those gradients. If you write a procedure for this, I can add it easily.

DelphiFreak i've taken your patch into account.

talk with eny
http://lazarus.freepascal.org/index.php?action=profile;u=39446

the author of Gradient Filler, I only did Double Gradient  ::)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 01, 2011, 02:42:02 am
Here is a new version (2.2) with :
-magicwand (selection)
-polygonal and spline selection
-command line (see http://wiki.lazarus.freepascal.org/LazPaint )
-fewer forms created at startup
-more config saved (for ex: custom blur remembers last mask)
-cursors on ubuntu

http://sourceforge.net/projects/lazpaint/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 01, 2011, 11:30:11 am
I noticed that Graphics32 have a LGPL implementation of direct drawing on the canvas. It may be worth trying to copy these Canvas drawing methods into BGRABitmap.

Until now, BGRABitmap is fast on Windows, but slower on other platforms because it goes through the creation of a bitmap handle before drawing.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on March 01, 2011, 01:18:31 pm
-Add options for default Size image
-Increase Undo max number to 100 (at least).
-Add shortcuts for color & tool window to show/hide
-Add shortcuts for Zooming in/out on the picture Ctrl+MouseWheel

Or better, add an Options window where users can customize
such options.

Edit:
-Save options like Opacity/Light & Foreground and Background colors
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 01, 2011, 04:29:57 pm
-Add options for default Size image
It's already the case.

Quote
-Increase Undo max number to 100 (at least).
Well, with compression, it could be ok.

Quote
-Add shortcuts for color & tool window to show/hide
Ok.

Quote
-Add shortcuts for Zooming in/out on the picture Ctrl+MouseWheel
Ok. Simple MouseWheel to zoom in and out.

Quote
Edit: -Save options like Opacity/Light & Foreground and Background colors
Ok.

I've found how to create a DIB section in gtk in Graphics32 library, and I applied it to BGRABitmap. So it should be faster on Ubuntu.

It's updated on subversion.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on March 01, 2011, 06:48:53 pm
Add support for saving forms' last position, size, and window state before exiting (that would be easy since you already use ini files).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: ik on March 01, 2011, 08:29:24 pm
I wrote about LazPaint in my blog (http://idkn.wordpress.com/2011/03/01/lazpaint/) and some people really liked it, but they wish to have a binary package (in Linux and Windows) because they do not have FPC and Lazarus.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 01, 2011, 09:24:14 pm
Add support for saving forms' last position, size, and window state before exiting (that would be easy since you already use ini files).
Ok.

I wrote about LazPaint in my blog (http://idkn.wordpress.com/2011/03/01/lazpaint/) and some people really liked it, but they wish to have a binary package (in Linux and Windows) because they do not have FPC and Lazarus.
Well I can only make Win64 files by myself.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Gintas on March 01, 2011, 11:23:00 pm
I see that when you set brush alpha to 255 it doesn't draw really smooth line. There is some white lines on it.
And when you open and press Save As it doesn't remove the extension. :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on March 02, 2011, 04:14:15 am
Quote
some people really liked it, but they wish to have a binary package (in Linux and Windows) because they do not have FPC and Lazarus.
That's easy to handle. I can make binaries for i386-win32, i386-linux (Kubuntu 10.10), and x86_64-win64.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 02, 2011, 06:06:30 pm
I see that when you set brush alpha to 255 it doesn't draw really smooth line. There is some white lines on it.
Can you post a screenshot of this ?
Quote
And when you open and press Save As it doesn't remove the extension. :)
What sequence of action you do, and what would you expect exaclty?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 02, 2011, 06:07:29 pm
That's easy to handle. I can make binaries for i386-win32, i386-linux (Kubuntu 10.10), and x86_64-win64.
Cool. Can I give you access to Sourceforge repository, or do you know another way?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on March 02, 2011, 07:04:35 pm
as we spoke by mail circular, i'd be happy to have access to the svn too
and contribute to improvements/new features
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 02, 2011, 07:33:48 pm
Hello people,

Here is a new version (2.3) with:
- added Filter plane
- save window position
- undo compression (up to 50 undo)
- backspace to remove last polygon point

https://sourceforge.net/projects/lazpaint/files/lazpaint/

FabienWang, i've added you to the members of LazPaint on SourceForge.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Gintas on March 03, 2011, 01:10:53 am
Here is screenshot from LazPaint with brush paint.
http://dl.dropbox.com/u/17084229/lazpaint22.png

About extensions. I simply open file "clouds.pdn" and push Save As PNG image. In Filename I still see the "clouds.pdn" and if I click ok I don't get any image saved. It's not a big bug,just most soft removes it automatically from a filename.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 03, 2011, 02:59:32 pm
Here is screenshot from LazPaint with brush paint.
http://dl.dropbox.com/u/17084229/lazpaint22.png
Ok, I see what you mean. Unfortunately, I do not know how to solve this perfectly. But I've made it better (on subversion).

Quote
About extensions. I simply open file "clouds.pdn" and push Save As PNG image. In Filename I still see the "clouds.pdn" and if I click ok I don't get any image saved. It's not a big bug,just most soft removes it automatically from a filename.
Ok, now it removes the extension before showing the dialog if the format is not savable.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 08, 2011, 09:22:16 am
New version 2.4 with minor fixes and with:
- a test program for BGRABitmap : for example how to use sprites

Drawing of transparent bitmaps on Gtk window canvas work in this version.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 08, 2011, 01:17:19 pm
Drawing of transparent bitmaps on Gtk window canvas work in this version.
It works! Thanks. Your solution should be as default drawing in GTK. Now icons in speedbuttons look very pretty
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 08, 2011, 06:00:47 pm
Cool !
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Gintas on March 09, 2011, 01:05:09 pm
Finally I see smooth antialiased lines :) The sprites test doesn't compile there is some unit missing,probably "testbgrafunc.lpr" file since Lazarus gives error about not found file "testbgrafunc".
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on March 09, 2011, 01:11:47 pm
I updated the SVN so you can now compile the testbgrafunc and enjoy demos :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 09, 2011, 05:48:28 pm
Oops I forgot the lpr file. Thank you Fabien Wang. But I guess it is in the last format of Lazarus, maybe it cannot be read by older version (0.9.28).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on March 09, 2011, 05:52:57 pm
humm yes i haven't try with 0.9.28
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 09, 2011, 05:55:07 pm
Ok, i've tried. It works, but the following line must be commented out :
Quote
RequireDerivedFormResource := True;

What is this line for?
Maybe with a compiler directive can we make a version that works directly on both Lazarus ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DirkS on March 09, 2011, 06:14:41 pm
Ok, i've tried. It works, but the following line must be commented out :
Quote
RequireDerivedFormResource := True;

What is this line for?
Maybe with a compiler directive can we make a version that works directly on both Lazarus ?
See http://wiki.lazarus.freepascal.org/Lazarus_0.99.0_release_notes#TCustomForm.Create_raises_an_exception_if_resource_is_not_found

So if you're using a resource-less form you should use Form.CreateNew instead of .Create.

Gr.
Dirk.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 09, 2011, 06:24:57 pm
I understand but there was no such line in previous version of Lazarus.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DirkS on March 09, 2011, 06:39:19 pm
I understand but there was no such line in previous version of Lazarus.
AFAIK if you use CreateNew it should compile in all versions...

Gr.
Dirk.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 09, 2011, 08:24:10 pm
I don't know, the line is :
Quote
Application.CreateForm(TFMain, FMain)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on March 09, 2011, 10:14:14 pm
I don't know, the line is :
Quote
Application.CreateForm(TFMain, FMain)

This line is correct. I just commented the "RequireDerivedFormResource := True;" as it's only for the new lazarus, now it should compile on all Lazarus versions
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: DirkS on March 09, 2011, 11:35:08 pm
I don't know, the line is :
Quote
Application.CreateForm(TFMain, FMain)

This line is correct. I just commented the "RequireDerivedFormResource := True;" as it's only for the new lazarus, now it should compile on all Lazarus versions
IMHO that's the wrong way around... if the main form does not use a 'normal' resource it should be created with CreateNew. In the not too distant future you'll probably have to change it anyway, so why not now?

Gr.
Dirk.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on March 10, 2011, 12:38:06 am
Fixed now.
I have reconstruct LPI and LPR files so it will compile on all Lazarus versions.
Tell me if it works DirkS please :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 10, 2011, 04:49:21 pm
In fact it was already working on v0.9.28 with a project with .pas. It was ok. The only thing was this little line with the boolean.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Gintas on March 11, 2011, 03:19:56 pm
I updated the SVN so you can now compile the testbgrafunc and enjoy demos :)

Just tested on Linux and works like a charm. Those demos gives me some ideas :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 11, 2011, 04:10:50 pm
Cool  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 11, 2011, 10:58:48 pm
@circular. I am experimenting with TBGRABitmap. Most of lazarus components (e.g. TToolBar) which have ImageList property, using this imagelist to draw icon (TImageList.Draw). So I change TImageList.Draw method to virtual and create TBGRAImageList component which inherit from TImageList and override Draw method (don't pay attention to performance, I am not familiar in drawing, I am only testing):
Code: Pascal  [Select][+][-]
  1. type
  2.  
  3.   { TBGRAImageList }
  4.  
  5.   TBGRAImageList = class(TImageList)
  6.   private
  7.     { Private declarations }
  8.     FBGRA: TBGRABitmap;
  9.   protected
  10.     { Protected declarations }
  11.   public
  12.     { Public declarations }
  13.     constructor Create(AOwner: TComponent); override;
  14.     destructor Destroy; override;
  15.  
  16.     procedure Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
  17.       ADrawEffect: TGraphicsDrawEffect); override;
  18.   published
  19.     { Published declarations }
  20.   end;    
  21.  
  22. procedure TBGRAImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
  23.   ADrawEffect: TGraphicsDrawEffect);
  24. var
  25.   bmp: TBitmap;
  26. begin
  27.   //inherited; - We use TBGRABitmap drawing only
  28.  
  29.   // This is required part from TImageList.Draw
  30.   if (AIndex < 0) or (AIndex >= Count) then Exit;
  31.   ReferenceNeeded;
  32.  
  33.   // My code
  34.   bmp := TBitmap.Create;
  35.   GetBitmap(AIndex, bmp, ADrawEffect);
  36.   FBGRA := TBGRABitmap.Create(bmp);
  37.   //FBGRA.Assign(bmp); <- this dosen't work so I use above constructor
  38.   FBGRA.Draw(ACanvas, AX, AY, True);
  39.   // This works without error but have no alpha channel
  40.   //ACanvas.Draw(AX, AY, FBGRA.Bitmap);
  41.   bmp.Free;
  42.   FBGRA.Free;
  43. end;
  44.  
See comments. ACanvas.Draw works but without alpha channel. FBGRA.Draw raise some strange exception SIGFPE. This is last call stack:
Quote
#0 RAISEGDBEXCEPTION(0xa1c3e0 'TGtk2WidgetSet.CreateBitmapFromRawImage Incompatible BitsPerPixel') at lclproc.pas:1544
#1 RAWIMAGE_CREATEBITMAPS(0x7ffff7f86ed0, {DESCRIPTION = {FORMAT = RICFRGBA, WIDTH = 32, HEIGHT = 32, DEPTH = 24, BITORDER = RIBOBITSINORDER, BYTEORDER = RIBOLSBFIRST, LINEORDER = RILOTOPTOBOTTOM, LINEEND = RILEDWORDBOUNDARY, BITSPERPIXEL = 24, REDPREC = 8, REDSHIFT = 16, GREENPREC = 8, GREENSHIFT = 8, BLUEPREC = 8, BLUESHIFT = 0, ALPHAPREC = 0, ALPHASHIFT = 0, MASKBITSPERPIXEL = 0, MASKSHIFT = 0, MASKLINEEND = RILETIGHT, MASKBITORDER = RIBOBITSINORDER, PALETTECOLORCOUNT = 0, PALETTEBITSPERINDEX = 0, PALETTESHIFT = 0, PALETTELINEEND = RILETIGHT, PALETTEBITORDER = RIBOBITSINORDER, PALETTEBYTEORDER = RIBOLSBFIRST}, DATA = 0x7ffff7fbe310 'M' <repeats 39 times>, #255#255#255#255#255#255#255#255#255'M' <repeats 24 times>, #255 <repeats 24 times>, 'M' <repeats 39 times>, #255#255#255'M' <repeats 33 times>, #255 <repeats 21 times>, 'MMMMMMMM'..., DATASIZE = 3072, MASK = 0x0, MASKSIZE = 0, PALETTE = 0x0, PALETTESIZE = 0}, 140737353512256, 0, false) at gtk2/gtk2lclintf.inc:407
#2 RAWIMAGE_CREATEBITMAPS({DESCRIPTION = {FORMAT = RICFRGBA, WIDTH = 32, HEIGHT = 32, DEPTH = 24, BITORDER = RIBOBITSINORDER, BYTEORDER = RIBOLSBFIRST, LINEORDER = RILOTOPTOBOTTOM, LINEEND = RILEDWORDBOUNDARY, BITSPERPIXEL = 24, REDPREC = 8, REDSHIFT = 16, GREENPREC = 8, GREENSHIFT = 8, BLUEPREC = 8, BLUESHIFT = 0, ALPHAPREC = 0, ALPHASHIFT = 0, MASKBITSPERPIXEL = 0, MASKSHIFT = 0, MASKLINEEND = RILETIGHT, MASKBITORDER = RIBOBITSINORDER, PALETTECOLORCOUNT = 0, PALETTEBITSPERINDEX = 0, PALETTESHIFT = 0, PALETTELINEEND = RILETIGHT, PALETTEBITORDER = RIBOBITSINORDER, PALETTEBYTEORDER = RIBOLSBFIRST}, DATA = 0x7ffff7fbe310 'M' <repeats 39 times>, #255#255#255#255#255#255#255#255#255'M' <repeats 24 times>, #255 <repeats 24 times>, 'M' <repeats 39 times>, #255#255#255'M' <repeats 33 times>, #255 <repeats 21 times>, 'MMMMMMMM'..., DATASIZE = 3072, MASK = 0x0, MASKSIZE = 0, PALETTE = 0x0, PALETTESIZE = 0}, 140737353512256, 0, false) at include/lclintf.inc:159
#3 DATADRAWOPAQUE(0x7ffff7feb120, 0x7ffff7e0ce00, {LEFT = 2, TOP = 1, RIGHT = 34, BOTTOM = 33, TOPLEFT = {X = 2, Y = 1}, BOTTOMRIGHT = {X = 34, Y = 33}}, 0x7ffff7fbb950, RILOTOPTOBOTTOM, 32, 32) at ../lazpaint/bgrabitmap/bgradefaultbitmap.pas:3979
#4 DRAW(0x7ffff7feb120, 0x7ffff7e0ce00, 2, 1, true) at ../lazpaint/bgrabitmap/bgradefaultbitmap.pas:1060
#5 DRAW(0x7ffff7e04340, 0x7ffff7e0ce00, 2, 1, 0, GDENORMAL) at bgraimagelist.pas:66
#6 DRAW(0x7ffff7e04340, 0x7ffff7e0ce00, 2, 1, 0, true) at include/imglist.inc:495
#7 PAINT(0x7ffff7fbb530) at include/toolbutton.inc:356
#8 WMPAINT(0x7ffff7fbb530, {MSG = 15, UNUSEDMSG = 32767, DC = 140737352024128, PAINTSTRUCT = 0x0, RESULT = 0}) at include/graphiccontrol.inc:64
#9 SYSTEM_TOBJECT_$__DISPATCH$formal at :0
#10 DESTROY(0x7ffff7fbb530, 0x7fffffffd538) at include/graphiccontrol.inc:46
#11 PERFORM(0x7ffff7fbb530, 15, 140737352024128, 0) at include/control.inc:1083
#12 PAINTCONTROLS(0x7ffff7fbab70, 140737352024128, 0x0) at include/wincontrol.inc:4791
#13 PAINTHANDLER(0x7ffff7fbab70, {MSG = 15, UNUSEDMSG = 0, DC = 140737352024128, PAINTSTRUCT = 0x7ffff7f758e0, RESULT = 0}) at include/wincontrol.inc:4709
#14 WMPAINT(0x7ffff7fbab70, {MSG = 15, UNUSEDMSG = 0, DC = 140737352024128, PAINTSTRUCT = 0x7ffff7f758e0, RESULT = 0}) at include/wincontrol.inc:6560
#15 WMPAINT(0x7ffff7fbab70, {MSG = 15, UNUSEDMSG = 0, DC = 140737352024128, PAINTSTRUCT = 0x7ffff7f758e0, RESULT = 0}) at include/customcontrol.inc:112
#16 SYSTEM_TOBJECT_$__DISPATCH$formal at :0
Have you any idea? This can solve most problems with alpha on lazarus GTK
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: IndianaJones on March 12, 2011, 12:04:26 am
@circular
Here is the screenshot of the Colorize also Shift Colors is the same in Mac.
And Colorize menu could be Single Borderstyle. These are the minor changes I notice.
Anyway the processing of the application goes well by the way.   :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 12, 2011, 10:23:57 am
@dibo

I've updated Assign function so now it should take transparency into account.

I don't understand why this error pops up. I tested BGRA drawing on forms and it was working fine. Does the bgrafunctest work on your configuration ?

Maybe you are using BGRADefaultBitmap unit instead of BGRABitmap unit. It should not use DataDrawOpaque of TBGRADefaultBitmap but DrawOpaque from TBGRAGtkBitmap instead.

But you are using TBGRABitmap that should redirect to the right implementation. So maybe is there a problem with the $IFDEF.

@indianajones

There was a problem of font size, it's fixed. Every form must have a font size set to avoid it to change according to system configuration. If font size is zero, then it's kind of random.

About BorderStyle, here on Windows, if I set to Single border, the form becomes sizable.

I don't understand why you have the size thing at the bottom right, because Dialog border should not be sizable. By the way, what does Single border mean exactly for a form ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 12, 2011, 04:12:15 pm
I've updated Assign function so now it should take transparency into account.
Works, thanks.
Quote
I don't understand why this error pops up. I tested BGRA drawing on forms and it was working fine. Does the bgrafunctest work on your configuration ?

Maybe you are using BGRADefaultBitmap unit instead of BGRABitmap unit. It should not use DataDrawOpaque of TBGRADefaultBitmap but DrawOpaque from TBGRAGtkBitmap instead.

But you are using TBGRABitmap that should redirect to the right implementation. So maybe is there a problem with the $IFDEF.
If I draw with Opaque=False then there is no error but it draw without alpha. But you have right that somethin wrong is with compiler defines. I have GTK2 but it uses this block in BGRABitmap unit:
Code: Pascal  [Select][+][-]
  1. {$ELSE}
  2.   BGRADefaultBitmap,
  3. {$ENDIF}  
  4.  
But only when I use TBGRABitmap in this component. In simple project it uses correct units. Strange...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 12, 2011, 05:52:49 pm
Ok, I found it. My component package did not have "LCL" package in require section. Now everything works :) . I publish this components soon.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 12, 2011, 08:31:11 pm
Cool. If I understand, it's a replacement for TImageList. But does it change the rendering of toolbars ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 13, 2011, 03:59:16 pm
Exactly. Teeview too.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 13, 2011, 04:21:02 pm
Ok. I created patch in bugtracker. I publish component when patch will be accepted. Sneak peak in attachments (before / after)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 13, 2011, 08:42:50 pm
Nice  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 21, 2011, 05:45:33 pm
Hello people, here is a new version (2.6) of LazPaint :
- fast blur and other blurs optimization
- water and perlin noise in filter menu

It is available as a zip file and on subversion.
https://sourceforge.net/projects/lazpaint/files/lazpaint/

I'm thinking about adding phong shading as a tool in LazPaint.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 21, 2011, 06:33:37 pm
I'm wondering, maybe you can create BGRABitmap classes as external lazarus package? I must always include BGRABitmap files into my BGRAImageList component. If I don't include then user must select path to lazapaint folder in BGRAImageList package options.
If BGRABitmap will be as lazarus package then I could add it as requied package in my package and don't need copy sources. It will make BGRABitmap more accessible for other components.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 21, 2011, 07:17:27 pm
Ok, I only need to create a lpk file ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 21, 2011, 07:55:08 pm
I guess so. I crated my like in this article:
http://wiki.lazarus.freepascal.org/How_To_Write_Lazarus_Component
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Chronos on March 21, 2011, 08:07:24 pm
Definitely it should be distributed as lazarus package. If someone want to include files itself in it's project it can.

This graphics library is impressive as I was digging deeper to it's internals I found many interesting algorithms.  

But recently I was trying to squeeze bitmap on screen rendering to the max and Drawing to visual component Canvas is fastest method. I would rather see direct copy internal data to target bitmap rawimage. As FBitmap with RawImage is already contained in TBGRADefaultBitmap it could be redirected directly to TImage.Picture.Bitmap and keep internal bitmap data associated with external component. It would be better to eliminate unnecessary copy operations.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 21, 2011, 08:27:52 pm
Definitely it should be distributed as lazarus package. If someone want to include files itself in it's project it can.
Ok. I found how to make a runtime package, so it can be used without compiling Lazarus. But, is it necessary to make a design package in order to use it on components ?

Quote
But recently I was trying to squeeze bitmap on screen rendering to the max and Drawing to visual component Canvas is fastest method.
I don't understand.

Quote
I would rather see direct copy internal data to target bitmap rawimage.
What code do you suggest ? Which methods would be changed ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 21, 2011, 10:13:57 pm
Ok. I found how to make a runtime package, so it can be used without compiling Lazarus. But, is it necessary to make a design package in order to use it on components ?
I have no such knowledge about lazarus packages but there is a lot of packages which have no components on components palette (e.g. dcpcrypt, manualdock) so I think this is acceptable practice to create package without components.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 22, 2011, 01:36:23 am
Yes, and it works. It's on subversion. But I wonder if I should check "Design and runtime package".

Now, only "Runtime package" is checked so it cannot be compiled into Lazarus. It is faster thus to update. But I do not know what happens if you want to use it with a component.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Chronos on March 22, 2011, 07:13:14 am
I referred to wiki page http://wiki.freepascal.org/Fast_direct_pixel_access#TBitmap.RawImage where TImage can be used on form instead of Form canvas or PaintBox canvas which needs to be repainted by OnPaint event. It would be even faster you would store bitmap data in same format in your internal data and in on screen image bitmap data. Then simple Move would be used instead of slow for cycle. But in this case you can directly map TImage bitmap rawimage data as your internal data and then your class would work like wrapper. But rawimage data is platform dependent so it needs to be tested and properly handled.

Question is for what purpose you have FBitmap and LoadFromBitmapIfNeeded if it is not possible to use own bitmap in place (no setter for Bitmap property). You have already FData, FWidth, FHeight and BGRA pixel format.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 22, 2011, 01:06:39 pm
The base data structure is BGRA data. When you access to the Bitmap property, it is converted to a TBitmap for convenience. You can make changes to the Bitmap canvas, but then it must be updated to the BGRA data.

There are two possibilites :
- either a DIB section is possible which means that a TBitmap can be mapped directly to the BGRA data.
- or it's not possible or not implemented, then there is a copy between BGRA data and Bitmap handle. In this case, LoadFromBitmapIfNeeded loads the data from the Bitmap handle. And InvalidateBitmap signals that the TBitmap object must be built again, that the Bitmap handle is no longer updated.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 22, 2011, 01:16:19 pm
Yes, and it works. It's on subversion. But I wonder if I should check "Design and runtime package".

Now, only "Runtime package" is checked so it cannot be compiled into Lazarus. It is faster thus to update. But I do not know what happens if you want to use it with a component.
I don't know if exists another (better) way to share modules between components like design lazarus package. Maybe someone else could comment here about this. I see it like this: I'm downloading and installing BGRABitmap package like other components. Now I can add this package as requied in my package, so no one can install my package without installing BGRABitmap package first. I can use BGRABitmap units adding them to uses section but I do not have to know path to this units. This same with projects. You could then distribute lazpaint and bgrabitmap like separated projects by adding bgrabitmap package as requied in lazpaint project (project -> project inspector -> requied packages). With this way everyone can easily use power of BGRABitmap without downloading lazpaint. Or I am wrong...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 22, 2011, 05:13:09 pm
No, I understand what you mean, and I agree, but personnally I have trouble in compiling Lazarus. Maybe it's because I'm using Win64.

Lately, I've got trouble even when using runtime package only. It says that one unit is not used in another unit whereas it is used. And it says another error message.

I can't make it work, so maybe I will use directory linking (adding to search path) for LazPaint and testbgrafunc, but with a package file if someone want to compile it as a design package.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 30, 2011, 12:03:37 am
I have question. I crated component TBGRAImageList especialy for GTK alpha. I never tested it on Windows until today. On GTK it works perfect but on windows it seems like it draw some artifacts instead of alpha. See attached images. What I do wrong? Code:
Code: Pascal  [Select][+][-]
  1.   TBGRAImageList = class(TImageList)
  2.   private
  3.     { Private declarations }
  4.     FBGRA: TBGRABitmap;
  5.     FBmp: TBitmap;  
  6.  
  7. ..........
  8.  
  9. procedure TBGRAImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
  10.   ADrawingStyle: TDrawingStyle; AImageType: TImageType;
  11.   ADrawEffect: TGraphicsDrawEffect);
  12. begin
  13.   //inherited; - We use TBGRABitmap drawing only
  14.  
  15.   // This is required part from TImageList.Draw
  16.   if (AIndex < 0) or (AIndex >= Count) then Exit;
  17.   ReferenceNeeded;
  18.  
  19.   // BGRA Drawing
  20.   GetBitmap(AIndex, FBmp, ADrawEffect); //getting image from image list
  21.   FBGRA.Assign(FBmp);
  22.   FBGRA.Draw(ACanvas, AX, AY, True);
  23. end;  
  24.  
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on March 30, 2011, 12:14:33 am
Ehh I wrote to fast. Changing param Opaque to False solve problem on windows
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 30, 2011, 01:41:59 pm
Ok.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 01, 2011, 06:21:22 pm
Here a new version of LazPaint (2.9) with texture fill.

If you missed it, there is pen styles and line caps. You can combine both : draw a dotted line with a textured pen.

Now LazPaint has a dependency towards BGRABitmap as an installed package.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on April 02, 2011, 12:41:54 am
Do you need some help to provide binaries? I believe many image editor users aren't programmers and not familiar with programming environment, which is required to compile lazpaint. Most of the time they will lose interests in project providing no binaries. I can help building for i386-win32, x86_64-win64 (crossed from win32) and i386-linux.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 02, 2011, 01:22:20 am
Yes, I would be happy if you provided binaries. If you have a sourceforge account, you can tell me and I'll add you to the project.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on April 02, 2011, 12:26:42 pm
I just updated the SVN,
i configured build modes (debug and release) (using stable release 0.9.30)
so if you compile in release you'll get a stripped and optimized binary directly.
(binaries will be out in debug/ or release/ folders) so the main project folder (which is the sources) will stay clean :).

@circular, i wanted to put binaries too, but only project admins can manage files.
so i let you do this or add me and leledumbo admins aswell :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 02, 2011, 01:33:20 pm
FabienWang, I checked "release technician" on your account. Does it allow you to upload files ?

I'm not sure how to make you admin and what it would change.

I'm still waiting for Leledumbo identifier on sourceforge.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on April 02, 2011, 01:42:33 pm
FabienWang, I checked "release technician" on your account. Does it allow you to upload files ?
Nice it works. I didn't know there was a release technician profile :) Thanks
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 02, 2011, 02:37:48 pm
I just updated the SVN,
i configured build modes (debug and release) (using stable release 0.9.30)
so if you compile in release you'll get a stripped and optimized binary directly.
(binaries will be out in debug/ or release/ folders) so the main project folder (which is the sources) will stay clean :).
I tested it. Nice work, thanks.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 02, 2011, 04:48:44 pm
I've added some computed textures to LazPaint (wood, stone...)

It's now version 3.0, available as a zip file.
https://sourceforge.net/projects/lazpaint/files/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on April 02, 2011, 06:26:30 pm
Quote
If you have a sourceforge account, you can tell me and I'll add you to the project.
It's leledumbo, I've been registered for some years there, but it wasn't easy to manage files (must use svn client, no web interface). Is it easier now? Or how do you want me to give the binaries?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 02, 2011, 08:24:07 pm
Yes it's easier now, you can do it from a web browser. I'm giving you access to LazPaint... done. Can you give it a try and tell me if it's ok ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on April 03, 2011, 01:23:46 am
I reorganized files folder, it was a mess.
src for the source
-old for old sources
bin for binaries
-old for old binaries

I provided 3.0 binaries for win32 and gtk2.
Leledumbo could you provide the following versions:
x86_64-win64
x86_64-qt
i386-qt
(if you use Qt/KDE, I only have GTK2 here).

Oh btw, files are even easier to manage via SSH :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 03, 2011, 01:08:22 pm
Thanks. But...

In the about box, the text displayed is readme.txt. If it's not here, it show an empty text box.
 8-)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on April 03, 2011, 01:44:37 pm
readme.txt added in the binaries zip
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 03, 2011, 04:05:51 pm
Thanks
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on April 03, 2011, 07:00:12 pm
Quote
Leledumbo could you provide the following versions:
x86_64-win64
x86_64-qt
i386-qt
Done:
x86_64-win64
x86_64-win64-qt
i386-win32-qt

I haven't got time to boot to linux because I have a work to do that must be done on windows.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 03, 2011, 08:17:10 pm
Thank you Leledumbo.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 08, 2011, 10:21:59 pm
LazPaint 3.1 with some changes :
- fill poly optimization (faster polylines)
- roundcap uturns fix
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on April 08, 2011, 11:23:55 pm
When i compile bgrabitmappack.lpk,
it says:

bgrabitmaptypes.pas(359,6) Error: No matching implementation for interface method "IUnknown.QueryInterface(const TGuid,out <Formal type>):LongInt; StdCall;" found

I'm using:
Lazarus 0.9.30-0 r FPC 2.4.2 i386-linux-gtk 2
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 11, 2011, 01:03:05 am
FabienWang, this problem should be fixed now, there was a difference between the interface and the prototype of the function in the implementation (compiler directives).

Here is a new version of LazPaint 3.2 with :
- picture deformation tool
- ask whether to retrieve area when using rotate or move selection tool

In testbgrafunc, there are some demos with texture mapping (a rotating cube).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 13, 2011, 04:23:29 pm
Here is a new version of LazPaint (3.3) with:
- twirl filter
- color change can be applied to a selection only

In BGRABitmap, I added twirl scanner in BGRATransform, and rectangular clipping (ClipRect/NoClipping).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 15, 2011, 12:50:59 pm
Version 3.4, with grid deformation fix.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Fred vS on April 15, 2011, 01:55:01 pm
@Circular.
Many, many congratulation, what a powerful graphic object !  ;D

Hum, have you a plan to create transparent panels (or, better, alpha-blend panels) ?  :-\

Lots of thanks.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 15, 2011, 06:09:11 pm
Thanks.

Do you mean controls to put in forms ?

Dibo has already done some controls, see here:
http://www.lazarus.freepascal.org/index.php/topic,12411.0.html

Maybe you could explain there what you need.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on April 15, 2011, 06:28:50 pm
Thanks.

Do you mean controls to put in forms ?

Dibo has already done some controls, see here:
http://www.lazarus.freepascal.org/index.php/topic,12411.0.html

Maybe you could explain there what you need.

That's I've searching for.  :'(

Thanks  :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Fred vS on April 15, 2011, 06:30:46 pm
@Circular.
Hello
Quote
Do you mean controls to put in forms ?

More or less...
Shaped forms can be set with shapeform() method, i do not have finded how to do it with panels.

I wish to have a transparent panel so you can see only the object on it (pictures, buttons, etc...)
and you do not see the background-panel.

Like for forms now :

Code: [Select]
form1.alphablended := true ;
i want :

Code: [Select]
panel1.alphablended := true ;

Also it can use the function bringtofront or senttoback of panel.

Thanks
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 15, 2011, 10:25:37 pm
New version of Lazarus 3.5 with :
- 3 different resample filters
- perfect polygonal junction : for example if you draw an ellipse with a border, or a rectangle with a border. In BGRABitmap, there is now TBGRAMultishapeFiller in unit BGRAPolygon which can do this with any shapes.

It is possible now to compute wide polyline points, that is the points the makes the polygons of a line. For example, with a dotted polyline, you can get a series of polygons that draw the dots.

I'm thinking about polygonal color gradients of any shape, but I'm stuck with the question of aliased borders. Same with texture mapped polygons.

It would be great also to have more resample filters, but I feel lazy about it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 15, 2011, 10:33:12 pm
Shaped forms can be set with shapeform() method, i do not have finded how to do it with panels.

I wish to have a transparent panel so you can see only the object on it (pictures, buttons, etc...)
and you do not see the background-panel.
I think I understand what you mean. This way you can put images over other components that are under the panel. I do not know how to do it.

I suppose it's possible. For example a TLabel has a transparent background.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on April 15, 2011, 11:28:03 pm
-renamed source files to *_src.zip
-created a 3.0 folder in bin/old/
-added new binaries zip for 3.5: win32 (with readme and manifest) and gtk2 (with readme)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 16, 2011, 12:47:09 pm
Thanks
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Fred vS on April 17, 2011, 04:48:02 pm
@Circular

Quote
I think I understand what you mean. This way you can put images over other components that are under the panel. I do not know how to do it.

Yep, you get it  ;D

Quote
I suppose it's possible.

Re-yep, good news...  ::)

Thanks
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Shebuka on April 19, 2011, 11:04:14 am
Trying 3.5 version, new compile error:

/Developer/lazarus/components/bgrabitmap/bgradnetdeserial.pas(74,14) Error: There is no method in an ancestor class to be overridden: "TDotNetDeserialization.ToString:AnsiString;"

and what is the third resample mode? i see only two:
TResampleMode = (rmSimpleStretch, rmFineResample);
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: marcov on April 19, 2011, 12:18:03 pm
Trying 3.5 version, new compile error:

/Developer/lazarus/components/bgrabitmap/bgradnetdeserial.pas(74,14) Error: There is no method in an ancestor class to be overridden: "TDotNetDeserialization.ToString:AnsiString;"

Sounds like an old compiler. IIRC tostring was introduced in FPC 2.4.2
 
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Shebuka on April 19, 2011, 04:34:54 pm
Trying 3.5 version, new compile error:

/Developer/lazarus/components/bgrabitmap/bgradnetdeserial.pas(74,14) Error: There is no method in an ancestor class to be overridden: "TDotNetDeserialization.ToString:AnsiString;"

Sounds like an old compiler. IIRC tostring was introduced in FPC 2.4.2
 
Your truth, my compiler was 2.4.0, now updating it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 19, 2011, 06:27:38 pm
and what is the third resample mode? i see only two:
TResampleMode = (rmSimpleStretch, rmFineResample);
ResampleMode indicates only if image is stretched without applying any filter, or by using filter to do a fine resample. The filter is defined by ResampleFilter property.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Shebuka on April 20, 2011, 10:37:33 am
and what is the third resample mode? i see only two:
TResampleMode = (rmSimpleStretch, rmFineResample);
ResampleMode indicates only if image is stretched without applying any filter, or by using filter to do a fine resample. The filter is defined by ResampleFilter property.
Hmm... So if i set rmSimpleStretch in .Resample it doesn't apply any filter, only Stretching? And if I set rmFineResample (or let it blank to autoset) it will use ResampleFilter in wich rfLinear is the fastest and simpliest and rfCosine is the slowes and the best?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 20, 2011, 12:08:31 pm
Yes, but there is no difference of speed between rfLinear, rfHalfCosine and rfCosine. It depends on what you want. If you want to see the pixels, choose rfCosine, if you want to see no pixel, choose rfLinear. rfHalfCosine is a mix of the two.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 20, 2011, 09:20:24 pm
Here is a new version (3.6) with new resample filters : Mitchell and Spline. I added also BestQuality filter which takes Mitchell or Spline depending on the size (Mitchell is better for downsizing and Spline better for upsizing).

I fixed the text bug in the color dialog.

https://sourceforge.net/projects/lazpaint/files/src/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 25, 2011, 11:17:46 pm
New version (3.7) with :
- pen preview
- faster blur
- enter key for validating polygone and spline
- config file in user directory
- nicer texture rendering and added vertical wood

Available here:
https://sourceforge.net/projects/lazpaint/files/src/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on April 26, 2011, 12:24:07 am
Nice work, i'll make binaries ASAP

Binaries for win32 and linux gtk2 available here:

https://sourceforge.net/projects/lazpaint/files/bin/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 26, 2011, 01:34:25 pm
Thanks.

The Mac version is buggy. I'm working on it in subversion.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 27, 2011, 07:10:51 am
I found a bug with textures generation when width <> height. It's fixed on subversion.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 29, 2011, 12:57:14 am
New version (3.8) with :
- some fixes for mac for paint events (still with a strange error message)
- pen preview auto-hide
- pen cursor reflecting current pen size
- some optimization of undo (there is still room for improvement here)

https://sourceforge.net/projects/lazpaint/files/src/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on April 30, 2011, 05:36:46 pm
New version (3.9) with :
- title contains version number
- menu help->check for updates
- update checker binary (done with lnet)

https://sourceforge.net/projects/lazpaint/files/src/ for source

https://sourceforge.net/projects/lazpaint/files/bin/ for binaries
(Binary Win32 and GTK2 are there)

here attached a screenshot of the update_checker (independant binary)

PS: Now is time to have a beer :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 30, 2011, 06:26:10 pm
That's a great idea.  :)

But, unfortunately, the item does not appear in the menu.  :'(

Maybe you published another directory that the one you are working on ?

I suppose you should republish v3.9 with the menu. By the way, I've also done some modifications on LazPaint, so you could publish our modifications at the same time.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on April 30, 2011, 06:36:03 pm
the menu appears if both binaries are in the same folder
of course you have to extract both from the zip or it won't work :)

PS: my bad i haven't tested in windows ^^
you're right. I'll wait for your changes for the 3.9
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 30, 2011, 07:01:02 pm
I'm not modifying anymore today. Maybe you already have the last version. Otherwise, just update.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on April 30, 2011, 07:14:08 pm
binaries, source zip, svn all updated ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 30, 2011, 07:26:21 pm
I've just tested. It works perfectly on Windows. Thanks  ::)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 21, 2011, 12:25:24 am
Here is a new version of LazPaint (4.1).


https://sourceforge.net/projects/lazpaint/files/src/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Blaazen on May 21, 2011, 01:13:30 am
Why did you skip version 4.0 ?  :)
You went from 3.9 to 4.1, or not ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 21, 2011, 10:39:11 am
Well, there was some version 4.0 on subversion, with some changes but not so much. If some people had downloaded this version on subversion, it's to avoid the confusion.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 21, 2011, 04:22:18 pm
Here is a new version of LazPaint (4.1).

  • with embedded version. It means that the program can be included in any LCL application. It is used now in LazPaint itself to edit current texture and custom blur mask. So for example, you can click on the texture (No tex icon), render the texture with the Render menu, validate, and then draw with the chosen texture.
  • with better transparency support for clipboard : you can cut'n'paste transparent bitmap parts between LazPaint instances and between LazPaint and Paint.NET.
  • with several spline styles : when using spline tool

https://sourceforge.net/projects/lazpaint/files/src/

Nice. Also update the version number in the lazpaint.iss (Lazarus team made a setup file that's read the version number from somewhere)

lazarus.iss
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/tools/install/win/lazarus.iss?root=lazarus
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 21, 2011, 06:51:14 pm
Done.  8)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 24, 2011, 08:06:38 pm
Done.  8)

And where are the binaries released?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 24, 2011, 08:52:36 pm
Nowhere.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on May 24, 2011, 10:49:42 pm
Not even true !
Version 4.1 binary for windows is here.
GTK2 version is coming in a few hour (i'm reinstalling my Linux OS).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 25, 2011, 04:18:41 am
Not even true !
Version 4.1 binary for windows is here.
GTK2 version is coming in a few hour (i'm reinstalling my Linux OS).

Ok. Please compile the setup program for Windows with InnoSetup (http://www.jrsoftware.org/isdl.php#stable). Open the lazpaint.iss with Inno Setup Compiler and press Ctrl + F9. The output file is created in the "installer" folder.

You can use ansi or unicode version (ansi works in older windows, unicode from XP).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 28, 2011, 08:48:27 pm
@Circular

You can add some GUI to filters and textures? In one Window all filters with their respective options.

Like http://wiki.lazarus.freepascal.org/Double_Gradient#Editor

Or like Photoshop http://www.aulaclic.es/photoshop-cs5/graficos/galeriafiltros.gif
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 28, 2011, 09:15:32 pm
Well, LazPaint is already a GUI, no ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 28, 2011, 10:59:46 pm
Well, LazPaint is already a GUI, no ?

Yes but I'm using LazPaint as default image viewer for their respective supported image format (believe it or not) and I like those filters  ;)

I need some more intuitive instead have to undo effects. I want a preview  8)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 29, 2011, 04:40:46 pm
I understand. Well, it is possible to add this in LazPaint. For now, I am reorganising the code so you'll have to be patient.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 29, 2011, 11:04:23 pm
I understand. Well, it is possible to add this in LazPaint. For now, I am reorganising the code so you'll have to be patient.

I'm used to wait with Lazarus but always get good results.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 30, 2011, 08:50:20 am
Thanks, that's encouraging.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on May 30, 2011, 09:00:26 am
So what are the next features to come in Lazpaint? :)

What if the update checker would get the binaries from sourceforge directly then restart the app :P.

What if we had layers like in Paint.Net (layers is just a group of objects with the same layer index which determine their z-order and you could set a transparency for the whole layer.

More effects & of course, as lainz said, an Effect Dialog with preview would be amazing :)

Any other ideas?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 30, 2011, 03:48:51 pm
So what are the next features to come in Lazpaint? :)

What if the update checker would get the binaries from sourceforge directly then restart the app :P.

This will be really nice. But test it in Windows 7 because UAC doesn't allow to put files in some folders without administrative permission.

What if we had layers like in Paint.Net (layers is just a group of objects with the same layer index which determine their z-order and you could set a transparency for the whole layer.

I'm waiting for this  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 31, 2011, 11:48:26 am
I think that it would be cool to add tools for text, triangle/quad gradients, and phong lighting.

I'm reorganizing the code to make it easier, with objects implementing each tool. This needs some refactoring.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 05, 2011, 10:30:57 am
Hi folks. I've done it, now it should be pretty easy to add new tools to the program. It can be done by deriving TGenericTool class and calling RegisterTool procedure in initialization section.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 05, 2011, 02:19:18 pm
I've added a preview for emboss, motion blur and twirl : while the dialog is shown, the image is updated, like with colorize and intensity dialogs.

I'm not sure how to do filter preview. Maybe with a thread.

EDIT: I've uploaded last changes as version 4.2 as a zip file. It's essentially to make source code available, because there are few changes from the user side.

Now, if someone make a new tool, it can be easily merged into the project. To do so, just create a unit as explained above (TGenericTool class and RegisterTool call).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 08, 2011, 05:11:53 pm
What if the update checker would get the binaries from sourceforge directly then restart the app :P.
I leave it to you FabienWang...

Quote
More effects & of course, as lainz said, an Effect Dialog with preview would be amazing :)
What effect for example ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on June 08, 2011, 05:47:58 pm
Quote
I leave it to you FabienWang...
I'll improve the update checker soon. (when i'll have more time).

I think about Outline effect, Pixelate effect. Anyone else got good effects to add?

I noticed another bug Circular.
On the about form, we only see the 255 first chars from the text (which is weird as you passed a String). Maybe the ReadFileToString?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 08, 2011, 08:44:00 pm
I've fixed the bug on subversion by adding {$H+} directive, which means use ansistrings (long strings).

I see what you mean by pixelate. But what do you mean by outline effect ?

Take your time with the update checker. It's already very cool.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 09, 2011, 07:24:02 pm
Quote
I leave it to you FabienWang...
I'll improve the update checker soon. (when i'll have more time).

You can do it High DPI for Windows?
http://wiki.lazarus.freepascal.org/High_DPI
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on June 09, 2011, 07:48:07 pm
Release version 4.2 :
- DPI Aware Update Checker
- preview for emboss, motion blur and twirl effects
- reorganized code with new classes

Sources :
https://sourceforge.net/projects/lazpaint/files/src/

Binaries (GTK2 and Win32) and Windows Installer :
https://sourceforge.net/projects/lazpaint/files/bin/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 09, 2011, 09:21:51 pm
Tested. The preview it's really nice. And the updater looks fine in High DPI.

PD: the shortcut in desktop must be 'LazPaint' and not 'lazpaint'.

#define MyAppName "LazPaint"
#define MyAppOutputName "lazpaint"

OutputBaseFilename={#MyAppOutputName}{#MyAppVersion}{#MyInstallerSuffix}
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 10, 2011, 02:48:50 pm
Thanks FW

lainz, do you want to have access to lazpaint subversion ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 11, 2011, 04:36:40 am
Hi FabienWang, please see here:

Inno Tools Downloader (with delphi source code included)
http://www.sherlocksoftware.org/page.php?id=50

With this can be made an update checker / downloader for Windows, see the examples, specially the example 3 (\Sherlock Software\InnoTools\Downloader\examples).

"http://lazpaint.sourceforge.net/latest.txt"

current

Code: [Select]
4.2
can be?..

Code: [Select]
4.2,"http://sourceforge.net/projects/lazpaint/files/bin/lazpaint4.2_setup_win32.exe"
If you modify the 'latest.txt' I can create a kind of 'online installer' that always download the latest version of LazPaint, to distribute in download sites. (pd: i'm waiting opinion of circular)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 11, 2011, 10:23:06 am
@lainz

I think it is a good idea to create a generic installer.

It can be possible to add some string after the version number but what you propose would be only windows friendly. It would be useful to know what programmers with lazarus on linux think about it.

It would be possible to determine the file to download by getting the web page :
http://sourceforge.net/projects/lazpaint/files/bin/
and find a link to an exe file. Maybe this list can be accessed another way, you know like doing "dir" in the online folder. Maybe there is a URL syntax for it.

Otherwise it would be necessary to parse the html file. For example the last setup is in the html element
<tr title="lazpaint4.2_setup_win32.exe" class="file">
It's rather easy to find, provided the html scheme does not change.


I've search the web for lazpaint and wow, LazPaint 4.2 is on many download sites !

They say that the author of the program is Fabien Wang... lol
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on June 11, 2011, 10:37:28 am
@lainz and @circular.

In my opinion, i'd rather open a new project to create a generic and multiplatform update checker which would also get the binaries and restart the app.

Or i could just do this in lazpaint, easily:
1) get the latest version from portable zip (due to the naming convention
lazpaint + version number + '_' + win32 or gtk2, it would be easy to download the zip directly)
2) rename the current binaries with a prefix "old_"
3) extract the downloaded zip in the app directory
4) exit lazpaint if opened
5) delete old files and start new lazpaint
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 11, 2011, 10:43:46 am
In fact, FW and lainz you're talking about two different things. Both are possible and useful.

FW what you propose would make the update process faster.

What lainz propose would be a generic downloader, not an updater. This downloader could download any program. I think that it would be great to have such downloader, that go on sourceforge site to know what the last version is. With some configuration, it could work for any program, not only LazPaint.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 14, 2011, 06:02:31 pm
Lainz, you've made a po file for translation. How does it work?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 14, 2011, 07:30:29 pm
Lainz, you've made a po file for translation. How does it work?

See here:

http://wiki.lazarus.freepascal.org/Translations_/_i18n_/_localizations_for_programs

I used "IDE options for automatic updates of .po files"-

PD: also I added High DPI procedures in each form in LazPaint (see image attached).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 15, 2011, 12:50:58 pm
@lainz: i've deactivated scaledpi in main form and in toolbox.

i just noticed that tool windows do not have their title anymore. any idea why?

i checked DPI aware application in project option, now I get "error while compiling resources"

by the way, where is the setting or the call to use po files ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 15, 2011, 06:12:37 pm
@lainz: i've deactivated scaledpi in main form and in toolbox.

I fixed the TToolBox
(See image attached).

i just noticed that tool windows do not have their title anymore. any idea why?

I have no idea.

i checked DPI aware application in project option, now I get "error while compiling resources"

I solved the problem.

by the way, where is the setting or the call to use po files ?

I've now added. Now the translation is done with the .po files on initialization.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 15, 2011, 10:42:59 pm
Thanks Lainz.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 15, 2011, 10:55:13 pm
Thanks Lainz.

Sorry if I have sent you a lot of messages =D

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 16, 2011, 12:11:28 am
lol that's ok
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on June 16, 2011, 11:59:22 am
ok I just added to the svn, the french translation po file :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 16, 2011, 12:21:28 pm
Cool. So Lazarus apps automatically search the i18n folder?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 16, 2011, 06:19:00 pm
@circular

See image attached.

The LazPaint main toolbar works now in HighDPI but with 2 issues:
* The tools selected in red that works with the shapes part of the toolbar works ok but the shapes toolbar isn't sized like the others.
* The 'Pen' text when I translate into spanish is 'Pluma' is clipped.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 17, 2011, 01:42:17 pm
I've fixed image list size, french translation, and color window size. There is now a ligther syntax for scaleDPI. Lainz, please check the problems you mentionned are solved.

Here is a screenshot.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 17, 2011, 06:21:49 pm
I've fixed image list size, french translation, and color window size. There is now a ligther syntax for scaleDPI. Lainz, please check the problems you mentionned are solved.

Here is a screenshot.

Solved. Thanks.

Still a problem (See image attached).

The "shapes toolbar" is not resized correctly in HighDPI.


I fixed it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on June 17, 2011, 08:04:07 pm
I have updated today bgrabitmap pack and lazarus from SVN and can't install bgrabitmap on linux. I get this error:
Quote
/lazpaint/bgrabitmap/bgrafilters.pas(206,76) Error: Can't determine which overloaded function to call
In line 206 is:
Code: Pascal  [Select][+][-]
  1. c := MergeBGRA(bmp.GetPixel(xb, yb), bmp.GetPixel(xb + 1, yb + 1));

Edit: Hmm this problem is in 4.0 and 4.1 too.
Edit2: It seems that this is problem with latest lazarus or FPC 2.5.1 which I updated because can't install ver. 3.5 from 2011-04-15 too and I don't think so that I have so old version before.
Edit3: I forced "rfLinear" param in bmp.GetPixel in few lines of BGRAFilters unit and now I can install
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 18, 2011, 05:00:38 pm
Strange. I updated with intermediary variables, does it fix the problem ?

I suppose the problem comes with inherited GetPixel function, but this is a private function so it should not interfere.

Lainz has added resourcestrings, I've translated them into french.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on June 18, 2011, 06:53:42 pm
Still can't install (this same problem)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 18, 2011, 08:54:05 pm
What if you remove the "overload" keyword on the first GetPixel definition in BGRABitmapTypes (on line 237) ?

Can you avoid the error with intermediary variables ?

Otherwise, can you give me the list of line numbers ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Sternas Stefanos on June 18, 2011, 09:11:13 pm
Same problem with the latest SVN FreePascal
has and GLScene, Graphic32 etc...
it's NOT bgrabitmap problem.
wait for more stable SVN release...
or use FreePascal SVN 17759
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 18, 2011, 10:27:04 pm
Thanks
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Dibo on June 18, 2011, 10:53:52 pm
As Sternas say this could be problem with latest FPC from svn, but if you want look at this, this are compiler errors when I try to install bgrabitmap pack:
Quote
lazpaint/bgrabitmap/bgrafilters.pas(207,45) Error: Can't determine which overloaded function to call
lazpaint/bgrabitmap/bgrabitmaptypes.pas(238,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(Single,Single,TResampleFilter="0"):<record type>;
lazpaint/bgrabitmap/bgrabitmaptypes.pas(237,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(LongInt,LongInt):<record type>;
lazpaint/bgrabitmap/bgrafilters.pas(211,79) Error: Can't determine which overloaded function to call
lazpaint/bgrabitmap/bgrabitmaptypes.pas(238,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(Single,Single,TResampleFilter="0"):<record type>;
lazpaint/bgrabitmap/bgrabitmaptypes.pas(237,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(LongInt,LongInt):<record type>;
lazpaint/bgrabitmap/bgrafilters.pas(283,58) Error: Can't determine which overloaded function to call
lazpaint/bgrabitmap/bgrabitmaptypes.pas(238,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(Single,Single,TResampleFilter="0"):<record type>;
lazpaint/bgrabitmap/bgrabitmaptypes.pas(237,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(LongInt,LongInt):<record type>;
lazpaint/bgrabitmap/bgrafilters.pas(651,49) Error: Can't determine which overloaded function to call
lazpaint/bgrabitmap/bgrabitmaptypes.pas(238,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(Single,Single,TResampleFilter="0"):<record type>;
lazpaint/bgrabitmap/bgrabitmaptypes.pas(237,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(LongInt,LongInt):<record type>;
lazpaint/bgrabitmap/bgrafilters.pas(652,49) Error: Can't determine which overloaded function to call
lazpaint/bgrabitmap/bgrabitmaptypes.pas(238,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(Single,Single,TResampleFilter="0"):<record type>;
lazpaint/bgrabitmap/bgrabitmaptypes.pas(237,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(LongInt,LongInt):<record type>;
lazpaint/bgrabitmap/bgrafilters.pas(653,49) Error: Can't determine which overloaded function to call
lazpaint/bgrabitmap/bgrabitmaptypes.pas(238,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(Single,Single,TResampleFilter="0"):<record type>;
lazpaint/bgrabitmap/bgrabitmaptypes.pas(237,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(LongInt,LongInt):<record type>;
lazpaint/bgrabitmap/bgrafilters.pas(654,49) Error: Can't determine which overloaded function to call
lazpaint/bgrabitmap/bgrabitmaptypes.pas(238,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(Single,Single,TResampleFilter="0"):<record type>;
lazpaint/bgrabitmap/bgrabitmaptypes.pas(237,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(LongInt,LongInt):<record type>;
lazpaint/bgrabitmap/bgrafilters.pas(1399,56) Error: Can't determine which overloaded function to call
lazpaint/bgrabitmap/bgrabitmaptypes.pas(238,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(Single,Single,TResampleFilter="0"):<record type>;
lazpaint/bgrabitmap/bgrabitmaptypes.pas(237,15) Hint: Found declaration: TBGRACustomBitmap.GetPixel(LongInt,LongInt):<record type>;
lazpaint/bgrabitmap/bgrafilters.pas(1503) Fatal: There were 8 errors compiling module, stopping
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 18, 2011, 11:10:58 pm
It seams the this version of FPC cannot guess if the result is an integer or a single. There is nothing we can do, except using intermediary variables for integers, but this is not wise. So please use another compiler...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 18, 2011, 11:21:04 pm
@circular

About Application.MainFormOnTaskbar seems to be unnecesary in the latest lazarus SVN too, so you can remove it.

I sent a message to FabienWang about translating the update_checker.po into french, but seems that today isn't connected

You can translate the .po file? Is in update_checker\release\i18n\update_checker.po

Just duplicate the .po file and translate it =)

If someone can please translate LazPaint & Update Checker into other language =)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on June 18, 2011, 11:38:48 pm
i'm here ! ^^
I'll do the french translation of update_checker.po

Done
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 19, 2011, 12:34:05 am
i'm here ! ^^
I'll do the french translation of update_checker.po

Done

Thankyou! Now LazPaint is fully translated!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 23, 2011, 08:50:22 pm
It would be great to have OpenGrabby and CPickSniff LazPaint

OpenGrabby to capture part of screen and store in clipboard (function in the main ToolBar / main Menu).

CPickSniff as advanced color picker / Color Pallete in another floating window (like ToolBox or ChoseColor).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on June 23, 2011, 09:10:14 pm
hummm, that might be very interesting indeed :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 24, 2011, 01:10:36 am
Maybe this could be done by making packages out of these programs.

And it would be useful to have "Paste as new image" command. This way, we could put images taken with PrintScreen key.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 30, 2011, 04:50:49 pm
There is a way to hide grids?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 30, 2011, 07:24:48 pm
No. It can be added in the View menu for example.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 01, 2011, 03:21:59 am
No. It can be added in the View menu for example.

Ok. is one of the two things that keep me using mspaint. The other is paste screen capture from clipboar automatically resize canvas size.  ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: PAEz on July 02, 2011, 07:31:35 pm
You should update the first post in this thread, the description really doesnt do your app justice.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 02, 2011, 11:14:54 pm
What do you suggest to add/change ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 04, 2011, 03:33:31 pm
 :-[

I can't run lazpaint in ubuntu 11.04

How I can install it?

PD: i'm installing lazarus with a script. getting lazarus from the software center is easy but I only get 0.9.28
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 04, 2011, 08:16:47 pm
It this a problem of compatibility with the version of Lazarus ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 04, 2011, 10:15:04 pm
Hey people,

On subversion, I've added Pixelate effect, Paste as new image, and Grid view on/off.

EDIT: just done commit
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 04, 2011, 11:42:16 pm
It this a problem of compatibility with the version of Lazarus ?

I solved it compiling LazPaint. The problem is with the compiled one on sourceforge, doesn't run on ubuntu.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 05, 2011, 03:36:36 pm
I commited upixelate.pas and .frm
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 05, 2011, 09:18:08 pm
Thanks for the nice improvements :)

I've updated .po files, please update french translation.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 06, 2011, 06:08:43 pm
You're welcome. I've done the French translation and added a keyboard shortcut for grid view CTRL-G.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: PAEz on July 08, 2011, 11:54:59 am
EDIT: Since what was in this post is now in the first post Ive deleted its contents so as to not chunk out the thread.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 08, 2011, 02:50:08 pm
Thanks. I've modified the first message of this topic with your html code with slight modifications. I added the language list.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 12, 2011, 04:46:16 am
@Fabien Wang

I think is time to add LazPaint 4.2.1:
* i18n (english, french, spanish)
* HighDPI
* New filters (pixelate)
* New commands (paste as new image / show - hide grids)
* Compiled with the last bgrabitmap
* Other things i don't know =D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 13, 2011, 09:35:48 am
Ok, i've uploaded as lazpaint 4.3 source code.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 14, 2011, 07:49:21 pm
Ok, i've uploaded as lazpaint 4.3 source code.

Well now only need to wait Fabien Wang upload the files at sf.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 14, 2011, 10:35:31 pm
I just notice that there is a bug with the clipboard. So maybe we should wait for version 4.4
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 14, 2011, 11:05:45 pm
I just notice that there is a bug with the clipboard. So maybe we should wait for version 4.4

Of course. Also we can post in the translation forum to get more translations?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 15, 2011, 11:58:35 am
Yes, of course.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 31, 2011, 08:16:42 pm
Hello people, here is version 4.4 of LazPaint. It uses last version of BGRABitmap (4.7.1).

It is available as a zip file and as a Windows installer.

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

To sum up, what is new compared with version 4.2 :
* Translation (english, french, german, czech, spanish)
* HighDPI
* pixelate filter
* New commands (paste as new image / show - hide grids)
* less memory used by undo
* text tool (with outline & shadow)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 03, 2011, 06:12:54 pm
Thanks  :D

I can't see the outline  :o

I'm using the bin from sourceforge-
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 03, 2011, 09:47:13 pm
Strange. Have you selected two different colors ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 03, 2011, 10:02:00 pm
Strange. Have you selected two different colors ?

I've deleted the LazPaint settings and now works. :-[
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 03, 2011, 10:02:48 pm
Oh, it's another subject, i've noticed that the compiled version was crashing when using selection tools.

Here I've uploaded a correct version of the exe file (4.4).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on September 18, 2011, 03:01:51 pm
can you add layers on lazPaint just like on Paint .NET? this may become a mini photoshop if it has some layer capability

and i also like to request for a zip download for the windows 4.4 version for portability

great app!!!  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 18, 2011, 09:48:24 pm
Thank you. Here is the zip version of it :
https://sourceforge.net/projects/lazpaint/files/src/

Adding layers is possible, but needs some work. And it needs to figure out how to do it.

Until now, there are some bugs with undo/redo and with cut'n'paste in some cases.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: TurboRascal on September 19, 2011, 01:24:16 pm
Congratulations for the effort to develop such a great program. I think I'll start installing it on all my customers machines (I'm in system support business) to boost it's popularity ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 19, 2011, 03:36:17 pm
Thanks.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 20, 2011, 03:30:09 am
Congratulations for the effort to develop such a great program. I think I'll start installing it on all my customers machines (I'm in system support business) to boost it's popularity ;)

Nice.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 23, 2011, 09:28:16 am
On subversion, added :
- clipboard fix (hope there is no more bug)
- crop ask to keep the transparent margin or not
- swedish translation (thanks to Daniel Eriksson)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on September 23, 2011, 10:51:41 am
Hello Circular, i'm at work right now was quite busy theses last days and have still no Internet at home.
But i take some time right now, to compile at least windows version.
Shouldn't we change version from 4.4 to 4.4.1 so people will get the update?

I'm changing version number to 4.4.1 so that people that had 4.4 will be informed on the update.
I will work soon on the auto-updater (with proxy options), and autocheck new version at startup option
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: garlar27 on September 23, 2011, 02:12:58 pm
Great work guys!!!

Some weeks ago I've installed 4.2 version and I couldn't find the text tool. Is it missing?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on September 23, 2011, 02:41:00 pm
Great work guys!!!

Some weeks ago I've installed 4.2 version and I couldn't find the text tool. Is it missing?
No the text tool is included. You find it in the tools popup second line, then when creating a text, another toolbar is shown on the right of the main toolbar.


I updated src files, moved old versions in old, put win32 zip and setup files,
updated the latest.txt file so the updater see the last version.
But i couldn't compile for gtk2 as i don't have linux in here.

I'll do as soon as i can (or if someone else can... :) )

Best Regards
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 23, 2011, 02:45:46 pm
@garlar:
Maybe text tool has been added in version 4.4.

@FabienWang:
Thanks Fabien.

Well, I just realized I had not updated BGRABitmap. Sorry.  :-[ Here is a new version 4.7.2 which is necessary to handle clipboard properly :
http://sourceforge.net/projects/lazpaint/files/src/

So you should do a 4.4.2 version now. Or just replace the exe file.

About Linux version, someone proposed to help me. Maybe he can do that.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 23, 2011, 03:18:39 pm
Ok, i'm posting LazPaint 4.4.2 (no difference in the source code, only at compile time)

EDIT: It's done. Fabien, can you update the version number for update checker to 4.4.2 ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 24, 2011, 03:54:40 pm
Nice.

Also Fabien if you go compile for linux you can create a 'setup' feed with 0install?

0install download
http://0install.net/install-linux.html

packaging with 0publish-gui
http://0install.net/packaging-binaries.html

It seems to be easy but the publish program is only available on Linux, currently i've only Win32.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: panoss on September 24, 2011, 10:22:36 pm
I 'm trying to run lazpaint and gives me an error message:
'\bgrabitmap\bgragradientscanner.pas(648,26) Error: Illegal qualifier
'
bgragradientscanner.pas(648,26) is the line with code:
  alpha := FMaskScanNext.red;

What should I do to run it?

bgrabitmap4.7.2
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 25, 2011, 05:03:25 am
I 'm trying to run lazpaint and gives me an error message:
'\bgrabitmap\bgragradientscanner.pas(648,26) Error: Illegal qualifier
'
bgragradientscanner.pas(648,26) is the line with code:
  alpha := FMaskScanNext.red;

What should I do to run it?

bgrabitmap4.7.2

No problem here Lazarus 0.9.31 r32381 FPC 2.4.4 i386-win32-win32/win64
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 25, 2011, 03:28:07 pm
@panoss: What happens if you replace by
  alpha := FMaskScanNext().red
?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 26, 2011, 03:11:49 pm
Now LazPaint is available in AllMyApps App Store:

http://allmyapps.com/apps/lazpaint-paint

Please install it from the store to give more popularity to LazPaint  ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: panoss on September 26, 2011, 04:01:49 pm
@panoss: What happens if you replace by
  alpha := FMaskScanNext().red
?
Sorry, but the error message I mentioned, appeared in a windows xp machine in an internet cafe, and now I don't have access to it  :-[.
But I tried lazpaint in my pc, ubuntu 11.04, lazarus  v0-9.30-0, lazpaint4.4.1, bgrabitmap4.7.2 and it compiles!
But, the two small forms (Tools form and Colors form) are frozen! They don't work!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 26, 2011, 07:06:20 pm
I have no idea why these forms would be frozen. What happens if you hide them and show them again using the View menu ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 26, 2011, 08:47:08 pm
I can confirm that problem, when I tested ubuntu some months ago.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 26, 2011, 10:32:47 pm
I posted a new version on subversion with :

- ask to merge selection when saving
- load and save selection
- avoid crash when closing with selection
- rewriting of undo/redo
- undo/redo bug fix

If someone can debug ubuntu version, it would be great.

I've posted a compiled version 4.4.1 for linux (thanks to Daniel) :
http://sourceforge.net/projects/lazpaint/files/bin/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 27, 2011, 04:58:52 am
Thanks.

You can add a feature to save .ico files? That's because IcoFx now is commercial  :(
http://wiki.lazarus.freepascal.org/Lazarus_Image_Editor
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 27, 2011, 09:52:20 am
It's not so easy to do because Icon can have multiple images.

Hey people, maybe i've found why the toolboxes were frozen. I was using ShowModal for main form. I've updated on subversion. Does it work on Linux now ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: panoss on September 27, 2011, 06:23:42 pm
Yes circular, I tried the subversion on Linux, it works fine! Thanks!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 27, 2011, 06:41:55 pm
Maybe now works in Mac too.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 27, 2011, 08:13:12 pm
Ok so here is last version LazPaint4.5 as zip and exe for Windows :
https://sourceforge.net/projects/lazpaint/files/bin/

It uses last version of BGRABitmap (4.8 )

I've asked Daniel for the Linux version.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 27, 2011, 08:48:04 pm
Ok so here is last version LazPaint4.5 as zip and exe for Windows :
https://sourceforge.net/projects/lazpaint/files/bin/

It uses last version of BGRABitmap (4.8)

I've asked Daniel for the Linux version.

You need to update the update checker website version.. I have the latest version 4.4.1 xD
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 27, 2011, 09:16:14 pm
I don't know how to do it yet. I'm asking FabienWang...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: benohb on September 28, 2011, 01:42:29 am
hi lainz

use http://upx.sourceforge.net/ (http://upx.sourceforge.net/) is Wonderful

4.5 to 1.8 mb executable linux
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on September 28, 2011, 07:28:33 am
Hi.

@benohb, yes but UPX means it will use more RAM to uncompress the binary at every start of lazpaint.
4.5 for such an application is NOTHING, look at Paint.Net for example, with the DLL i have 30MB after the installation... so LazPaint rocks :D

@circular and lainz, i updated the version number for the update checker. I also moved 4.4.1 and 4.4.2 files in the old directory.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 30, 2011, 12:36:21 pm
Thanks benohb for the tip.

I would say the first reason why upx is not used, is that it is an extra step added in the creation of the executable and we are lazy (well in fact I don't even have Linux).

Fabien points out that it needs more memory. Well I do not agree, if it is just one instance, but if multiple instances of LazPaint are used, it may take more memory.

I've tested with 20 instances on Windows. Without compression of the exe, it takes 110 MB of RAM, and with compression, it takes 158 MB. The difference is not so big. Of course, on the disk, it takes less space, only 1.1 MB instead of 3.5 MB.

The design of LazPaint is to hold only one image, so if someone works with multiple images, it will need to have multiple instances the program.

I've noticed that cut'n'paste does not work well between instances of LazPaint, the alpha channel is lost. This is something to improve in next version.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 01, 2011, 09:10:55 pm
Hello people, here is yet another version 4.6 with :
- phong shaded shapes tool (very beautiful)
- cut'n'paste between instances of LazPaint keeps transparency
- some minor fixes

It needs yet another version of BGRABitmap (4.9).

Source code available here :
http://sourceforge.net/projects/lazpaint/files/src/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 03, 2011, 12:09:10 am
I've published compiled version for Windows (installer and portable zip).

Can someone make Linux executables ? Linux done.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: mymas on October 03, 2011, 02:34:54 am
http://wiki.lazarus.freepascal.org/OS_X_Programming_Tips
https://gist.github.com/119f090146b245c44046

Hello. I try to build lazpaint4.6 in osx.
However $open lazpaint.app is not work, (Error: Unknown command : psn_0_5145832)
It's console launch is works well.
Maybe phong tooltip not appear.
Anyway thanks for new release.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 03, 2011, 09:06:47 am
Thanks. You're right about phong tooltip. It's fixed on subversion.

About unknown psn command, it reminds me of something. I thought it was fixed. If this error comes up inside Lazarus, you can try to debug it step by step (run the program with F7), if you have some time for this.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 07, 2011, 02:39:00 pm
What's new :
- Linux binaries version 4.6
- Optimisation of action state update

The action state, i.e, if undo can be applied etc. was using much CPU time with big images. I've optimized it so that images are checked only when necessary. Now the CPU usage, when not using the program is zero.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on October 07, 2011, 03:15:01 pm
phong shaded shapes <3

Nice one for the binaries mate :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 07, 2011, 07:26:25 pm
Hehe yes, so beautiful.

You mean "made"? Daniel did compile.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 22, 2011, 04:12:22 pm
Hello people, i've updated LazPaint on subversion :

- undo after drawing : this avoids the lag when starting to draw with big images (4000x3000 for example). You can resample a smaller image to check this.

- ctrl to snap to pixels : when drawing with pen or drawing polygons, you can press Ctrl to snap to pixels. This is useful when working on small images.

- shift to swap colors for polygons : as a polygon can only start with the left button, pressing shift allows to swap colors

EDIT :
- just added some optimizations for drawing, useful when working with big bitmaps
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: TurboRascal on October 26, 2011, 12:21:52 pm
Hmm, it seems I've hit a bug...

I've installed the 4.6 release on 32-bit XP, and the SaveAs doesn't seem to function properly:
- When I edit a JPEG file, it saves it again as JPEG, no matter what format I chose from the list
- When I create a new file, it saves it as PNG regardless of the format I chose; in this case the same goes if I use Save instead of SaveAs...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 26, 2011, 11:20:39 pm
I cannot reproduce this bug. I'm using Windows 7.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on October 31, 2011, 02:52:56 am
Hmm, it seems I've hit a bug...

I've installed the 4.6 release on 32-bit XP, and the SaveAs doesn't seem to function properly:
- When I edit a JPEG file, it saves it again as JPEG, no matter what format I chose from the list
- When I create a new file, it saves it as PNG regardless of the format I chose; in this case the same goes if I use Save instead of SaveAs...

yes i can confirm this bug too on windows xp 32-bit version
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 31, 2011, 11:06:05 am
Maybe it is a bug of TSaveDialog on XP.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 01, 2011, 07:21:16 pm
@Circular

You can add some 'TSpinEdit' in 'Color' floating window, to set RGB and Alpha from numbers?
Or a 'ColorDialog' with an Alpha 'TSpinEdit'.

Other thing I need about the selection tool, if can be faster using only a dotted line (like in the grid), because that's really slow when I zoom to x128. BTW if isn't faster a dotted line, is a good option to see the content I've selected.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 01, 2011, 10:34:20 pm
@Circular

You can add some 'TSpinEdit' in 'Color' floating window, to set RGB and Alpha from numbers?
Or a 'ColorDialog' with an Alpha 'TSpinEdit'.
That's a good idea.

Quote
Other thing I need about the selection tool, if can be faster using only a dotted line (like in the grid), because that's really slow when I zoom to x128. BTW if isn't faster a dotted line, is a good option to see the content I've selected.
I don't understand. The zoom does not make it slower. It's only slow if you've got a big image.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 02, 2011, 03:48:04 am
Quote
I don't understand. The zoom does not make it slower. It's only slow if you've got a big image.

You're right, is not a problem of the selection tool. When I zoom also painting is slow, in any image resolution (48x48 or 1000x1000). Maybe because i have an old video card and my desktop res is 1920x1080. When I select or paint with zoom the image fills the screen, repainting that is slow on my pc.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 02, 2011, 08:05:03 pm
I am surprised by this. Maybe it can be explained by cache. If the virtualscreen is big, it takes so much memory that the cache is not useful anymore.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: TurboRascal on November 05, 2011, 12:40:02 am
Maybe it is a bug of TSaveDialog on XP.

Uhm... what shall we do now?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 05, 2011, 12:54:01 pm
@TurboRascal:
You can run and debug step by step LazPaint code which uses TSaveDialog to check if values that are returned by this class or what you would expect. This would confirm that the problem lies in TSaveDialog class or the contrary, that LazPaint code should be changed. Depending on what is found, the solution is to modify LazPaint code or to send a bugreport to Lazarus team.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: TurboRascal on November 06, 2011, 12:10:25 am
Ok, I'll give it a try and report back.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on December 11, 2011, 05:38:48 pm
Here is a new version of LazPaint (4.7):
- language choice (in File menu)
- simple embedded usage (juste create TLazPaintInstance and call Run see test_embedded folder)
- CPU usage optimization
- Use Ctrl key to snap to pixel coordinates (useful when drawing pixel by pixel)
- More phong shapes
- Text can be shaded too
- LazPaint can be put on a USB key, by adding a lazpaint.ini file with ConfigFile=... in [General] section.

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

Portable version here :
http://framakey.org/Portables/LazPaintPortable
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on December 12, 2011, 07:33:43 pm
Here is a tutorial for drawing a vortex with LazPaint :
http://www.youtube.com/watch?v=9z6WgIaUYwQ
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on December 12, 2011, 08:02:22 pm
I've commented that video. I'ts really easy to use.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on December 12, 2011, 10:32:05 pm
Amazing mate !
I hope i can work on lazarus soon.... (will change home again soon lol)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on December 13, 2011, 12:52:35 am
Thanks folks
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on December 28, 2011, 06:36:47 pm
I've commited in rev 335 a fix (just renamed 'Next' to 'ANext') to be able to compile LazPaint in Lazarus trunc. 'Next' is now part of the mdi related routines in TForm.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on December 28, 2011, 09:56:01 pm
Ok.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on December 30, 2011, 04:47:26 pm
Coming soon : Mac version of LazPaint 4.7.  8-)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on January 01, 2012, 10:00:58 pm
Coming soon : Mac version of LazPaint 4.7.  8-)

You need to create a Facebook page for LazPaint, just create one page, when you have some users facebook let you choose an username for the page (something like facebook.com/lazpaint)

Then add a facebook icon in you app and you will have more and more users.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on January 02, 2012, 07:42:35 pm
Well I'm not on facebook.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on January 02, 2012, 07:52:09 pm
Well I'm not on facebook.

ok I can create one if it's ok.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on January 02, 2012, 08:46:48 pm
No problem. I would be grateful to you.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on January 02, 2012, 10:06:32 pm
No problem. I would be grateful to you.  :)

Here it is.
https://www.facebook.com/LazPaint

When you want I can add you as administrator. you just need a facebook account.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on January 02, 2012, 10:24:50 pm
Wow, that looks good.

Quote
When you want I can add you as administrator. you just need a facebook account.
Well I work for a secret service, so I must stay anonymous...  :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on January 02, 2012, 10:44:19 pm
Wow, that looks good.

Quote
When you want I can add you as administrator. you just need a facebook account.
Well I work for a secret service, so I must stay anonymous...  :D

lol  :-X  :-\
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fredycc on January 02, 2012, 10:49:29 pm
Wow, that looks good.

Quote
When you want I can add you as administrator. you just need a facebook account.
Well I work for a secret service, so I must stay anonymous...  :D
:o
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on January 02, 2012, 11:58:20 pm
Don't worry for me, it's a safe job.  ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on March 24, 2012, 12:30:53 pm
@circular

any chance on adding layers feature on LazPaint?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 24, 2012, 08:26:12 pm
Well, I do not have much time now, because I'm working on LazFreeType.

Can you give some help ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 24, 2012, 11:05:50 pm
We can start to think about layers. For example, which file format should PazPaint use to store layered bitmaps ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Ask on March 25, 2012, 03:05:56 pm
http://en.wikipedia.org/wiki/OpenRaster (http://en.wikipedia.org/wiki/OpenRaster) ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on March 26, 2012, 01:11:34 am
Can you give some help ?

as much as i want to help im not knowledgeable enough about graphics programming and im a noob in programming too cannot do OOP  %)

http://en.wikipedia.org/wiki/OpenRaster (http://en.wikipedia.org/wiki/OpenRaster) ?

that looks good thanks for suggesting
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 27, 2012, 10:57:13 am
Can you give some help ?

as much as i want to help im not knowledgeable enough about graphics programming and im a noob in programming too cannot do OOP  %)
Well you can learn  :)

Quote
http://en.wikipedia.org/wiki/OpenRaster (http://en.wikipedia.org/wiki/OpenRaster) ?

that looks good thanks for suggesting
Why not. I've already thought about it, I will look again if I find it satisfactory.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 27, 2012, 11:15:26 am
I've looked at OpenRaster again, and well the problem is that :
- it must be compressed with zip format (so a zip compressor/decompressor is needed)
- it uses PNG, which is not reliable on FreePascal

Have you a way to solve this ?

Or another format to propose ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Ask on March 27, 2012, 12:42:59 pm
Quote
- it must be compressed with zip format (so a zip compressor/decompressor is needed)
It is part of standard FPC library.

Quote
- it uses PNG, which is not reliable on FreePascal
That's bad, but I think in that case fixing PNG support would be
a worthy goal on its own, wouldn't it?

Quote
Have you a way to solve this ?
Post a bug report about PNG problems?

Quote
Or another format to propose ?
There's GIMP's XCF, but AFAIK GIMP developers themselves
say that OpenRaster is preferable as an interchange format.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 27, 2012, 05:09:44 pm
Quote
- it must be compressed with zip format (so a zip compressor/decompressor is needed)
It is part of standard FPC library.
Where ? I only know about zstream, which allows to compress but not in the zip format.

Quote
Quote
- it uses PNG, which is not reliable on FreePascal
That's bad, but I think in that case fixing PNG support would be
a worthy goal on its own, wouldn't it?
Yes. Some people have already posted about errors.

Quote
Quote
Or another format to propose ?
There's GIMP's XCF, but AFAIK GIMP developers themselves
say that OpenRaster is preferable as an interchange format.
There is also PSP and PSD formats.

In fact, any of these format contains features that I do not plan to implement, and do not contains features that I have implemented (more blend modes). Maybe there are workarounds for it with OpenRaster by combining filters. Otherwise I should reduce available blend modes.

So I guess I will anyway make a reader/writer with a format that correspond to LazPaint data. But I would like to have maximum interoperability, so the best would be to handle OpenRaster, PSP and PSD too.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: BigChimp on March 27, 2012, 06:59:11 pm
(Never having worked with LazPaint, graphics formats etc, so this might be a bit naive)

Having had a quick look at the wikipedia article on openraster, it seems the format at least allows you to specify extensions not yet in the base format.
I'd choose sensible magic numbers/identifiers for that and communicate with the openraster people. Looking at the number of implementers on the wikipedia site, they might be happy with any support they can get and might even want to include your extensions in a future release of openraster.

That would cover one part of the problem (until openraster decides to implement your extensions in a different way in a new version of openraster).

Then you have openraster features your code does not offer.
I'd simply ignore those; just say you support a subset of openraster.

This will:
- increase interoperability with other products
- clarify what format your product uses
- give direction for future development (even if that development is more meaningful error/warning messages when reading unsupported features)

Regarding zip formats: have a look at the TZipper (or TZip something) code, e.g. packages\fcl-base\examples\testzip.pp

My 2 cents...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 27, 2012, 09:40:55 pm
Thank you.

TZipper looks like what is need.

You are right about trying to communicate with other developers.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 20, 2012, 10:04:13 pm
What do you want to do with lazpaint?

It's already good.

In the LazPaint facebook page some girl ask how I can use it? there is some video or guide or something..

Depending which people you want to use LazPaint.

A professional graphic designer never will use LazPaint (at least i'm not professional, but I use graphic software as a pro), normal people  ::) don't know how to use a professional app.

LazPaint is in the middle, is not user friendly, and is not a pro tool.

Most user friendly apps are Autodesk Sketch Book Express available in Windows 8 metro application, Photoscape and others. Those don't need books or tutorials to use it.

Pro apps are Gimp and Inkscape.

You choose =)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 21, 2012, 08:39:12 pm
So I see to approaches here:
- doing so video tutorials
- changing the program to make more user-friendly

I don't really have time to change much of the program now, but doing video tutorials is possible. In fact, I did not think it was necessary, because LazPaint is easy to use. So it would be necessary only for newbies.

I don't think that professional would never use LazPaint. It is convenient for simple tasks. Even if I had some big programs like Adobe programs, I'm not sure I would launch them for any reason.

Anyway, there are surely some improvements that can be done. Just in case it would be easy to do, what changes in the program would make it more user-friendly ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 21, 2012, 11:00:10 pm
Ok, here is a first tutorial to get started with basic drawing functions.

https://www.youtube.com/watch?v=9G6XcQdBtDo
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 21, 2012, 11:31:07 pm
I thought very quickly, is easier lazpaint than photoscape.

The tutorial is really nice.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 22, 2012, 12:02:20 am
Well, in some way, I agree that it could be accompany more the user. But I'm a bit lazy.

Here is a second tutorial on advanced drawing tools (text, light, grid deformation) :

http://www.youtube.com/watch?v=UEGQk1UhJ2w
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on July 22, 2012, 01:16:50 am
At least someone who ever use m$ paint should have no problem in using LazPaint, everything is almost always intuitive.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 22, 2012, 01:18:48 am
You're welcome!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 26, 2012, 03:37:41 pm
Hello people,

Here is a new version of LazPaint (4.8 ) with:
- better "Shift colors" (menu Colors). A checkbox enables the correction of the usual HSL model.
- selection edition in grayscale (menu Selection)
- new "Texture mapping" tool
- import 3D objects (format *.obj)

There are no binaries, because I am waiting for some translations if some people have the time to do it.

It needs the lastest version of BGRABitmap (5.8 ). It is on subversion and the source code is available here :
http://sourceforge.net/projects/lazpaint/files/src/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 27, 2012, 02:56:35 pm
Here is new tutorial on selection :
http://www.youtube.com/watch?v=6zWohQYLW3g
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 12, 2012, 03:32:30 am
Nice usage of 'Colorize':

'Luz' ('Light')
http://lainzblog.blogspot.com.ar/2012/08/luz.html

really nice, faster than other paint apps.

Drawings using Inkscape, post production with LazPaint.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 12, 2012, 05:00:10 pm
Very nice  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 19, 2012, 08:29:39 pm
Hello people. Here are the binaries for Windows of LazPaint 4.8 :
http://sourceforge.net/projects/lazpaint/files/bin/

I've fixed another bug with PNG files : there is no more transparency issue with black color (it is replaced by RGB(0,0,1) instead when there is an alpha channel). It's not perfect but for most use it will be sufficient.

When PNG writer is fixed in FreePascal, this fix can be removed.

Languages fully translated : french, english and spanish :)

Can someone build the linux version ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on August 19, 2012, 09:30:38 pm
Quote
Can someone build the linux version ?
Done for i386 with GTK2 and Qt interface. Update checker in separate archive.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 20, 2012, 01:02:46 am
Thanks a lot  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 22, 2012, 05:51:19 pm
Here is a tutorial on how to do a projected shadow under a text :
http://www.youtube.com/watch?v=EmKzqKneJeI
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 22, 2012, 06:16:28 pm
nice video

you can grab any of my images if you want to use in your tutorials = http://lainz007.deviantart.com/

add me in facebook =)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 22, 2012, 06:31:13 pm
Ok.

What do you mean by adding you in facebook ? That if I use your images in a tutorial, it will end up on facebook ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 22, 2012, 07:19:59 pm
Add me on facebook = confirm as friend, nothing related with images.

I say that if you want you can use those images in any tutorial if you want  ::)

I need to practice my english a bit more..
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 22, 2012, 08:27:13 pm
And I need to practice facebook a little more.  ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: TurboRascal on August 30, 2012, 04:51:54 pm
And I need to practice facebook a little more.  ;)

You mean, give more info about you to the CIA?  O:-)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 30, 2012, 05:00:00 pm
Btw they already has a lot with Google AdSense / Google Analytics.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 30, 2012, 07:53:19 pm
And I need to practice facebook a little more.  ;)

You mean, give more info about you to the CIA?  O:-)
Yes, I know. I try to be careful with that.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 31, 2012, 03:48:13 am
I've downloaded Lazarus 1.0 x64 and still can't compile lazpaint. Any ideas?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 31, 2012, 06:49:47 pm
Cool, a new version of Lazarus.

Well LazPaint can be compiled. I only had to change line 217 of uchoosecolor to
Code: [Select]
                   pix := Colorcircle.bmpMaxlight.GetPixel(integer(x-ColorCircle.Bounds.Left),integer(y-ColorCircle.Bounds.top));
(adding integer because it cannot recognize which function to call)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 31, 2012, 10:29:11 pm
Nice. Now if you want you can do a single setup file that has both lazpaint.exe and lazpaint_x64.exe, the Inno Setup can check if your OS is x86 or x64 and install the adequate exe file.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 01, 2012, 11:51:12 am
Well LazPaint is not optimized for 64 bits. Some optimizations may even be disabled on 64-bit processors.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: JD on September 01, 2012, 01:56:08 pm
And I need to practice facebook a little more.  ;)

You mean, give more info about you to the CIA?  O:-)
Yes, I know. I try to be careful with that.

I see people are being more careful on FB now. You're very right!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 01, 2012, 05:06:40 pm
Well it's because they are getting aware of it because it has been talked about on TV (not sure about English syntax here  :D )

But they should ask themselves what exactly the CIA does, instead of being afraid of it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 02, 2012, 12:50:16 am
Ok no problem is working well the x86.

I'm using facebook with a configuration to show only to my friends the info (btw facebook can store all the data and I don't know to which people they are selling that info)..

LazPaint filters this time: first 'smooth' and then 'sharpen' to get this look =) Really I like Inkscape, but without effects that look terrible  :-[
http://fav.me/d5dca0b
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on September 02, 2012, 04:48:58 pm
yo circular sorry for being annoying but do you still have plans to add layers feature on LazPaint? thanks
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 02, 2012, 05:43:28 pm
Well that's ok that you remind me.

I was thinking about it recently. I guess I should use OpenRaster format. But I'm not sure about zip files.

It depends on the time that is available to me. I have sorted all the things I wanted to do on LazPaint recently (selection, 3D import). Now the next step will be layers for sure. I already have some ideas. Maybe I will use my own format to begin with.

The thing I think will be most confusing is the undo/redo function.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on September 04, 2012, 08:28:33 am
nice to hear that Layers feature is on your ToDo list.... waiting patiently, good luck  :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 17, 2012, 01:17:22 pm
I've got a working version of layers (see the thread http://www.lazarus.freepascal.org/index.php/topic,15342.msg102510.html#msg102510 ) with loading and saving file in OpenRaster format. The Xml reader and writer of Lazarus are great and so are the TZipper/TUnzipper classes. So finally I will not do yet another layered format special to LazPaint.

Now I was wondering if there should be an undo/redo list for each layer, or if it would be a good idea to allow undo restricted to one layer. For memory usage, it would be better to have one list only, but I guess it is possible to allow undo for one layer independently of others.

I also would like to remove the ability to undo/redo between files, because it can be confusing and can lead to file erasing. But then, some things will be impossible to do, unless I add multiple file editing, and I really don't want to mess with multiple file editing.

What do you think about it?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on September 17, 2012, 05:17:06 pm
I prefer having a global undo/redo, regardless of layers. People normally think undo as reverting their actions in order, wherever they are now (note that adding/removing layer is an action too).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 17, 2012, 06:23:01 pm
Yes as Leledumbo say, is the best way.

In some programs also selecting a layer is an undo/redo action. Corel Photo Paint and Photoshop store all the actions, then you can save those as a macro or script, and then you can recreate the whole image from those files, select the 'point' where you want to re-create, is a list of undo/redo actions.

- New File (640x480)
- Fill gradient (colors, position, etc)
- Twirl Filter (...)
- Import layer (box.png) >> for example you can clic this item in the list and go back to this point
- Select layer
- Rotate layer 180

It search the filenames i don't remember if in a full path or a relative path...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 18, 2012, 08:50:06 pm
Alright.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 21, 2012, 10:39:36 am
I'm going to do both undo/redo (global and layer) because they can be combined in a smart way. So you will be able to use one or the other, or even both at the same time. If it's not clear right now, you will understand when using it.

But first, I'm going to do layers without undo/redo at all as a first step. I will tell you when I'm done.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 21, 2012, 12:08:44 pm
I understand =)

If you apply a filter or draw something you're doing that in a layer, those steps are added to local layer undo/redo and global undo/redo. You can go back in any of them withouth any problems.

global1
global2 layer1-1
global3 layer1-2
global4 layer2-1
global5 layer1-3
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 21, 2012, 09:56:58 pm
Yes, that's what I am thinking about.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on September 24, 2012, 01:27:03 pm
Hello,
long time no see :)

So what's in the roadmap:
- Layers support
- Global/Layer undo/redo

I can suggest to add:
MDI with tabs for images ? (as Single window mode in The Gimp)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 30, 2012, 06:32:36 pm
Hmm, well, nope I will not do multiple image yet.

Current version in subversion is under development, undo/redo does not work at all, there is already some layer support. If you want a working version, use zip files (src or bin) :
https://sourceforge.net/projects/lazpaint/files/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on October 01, 2012, 05:15:56 am
Just downloaded the latest lazpaint to check it out, I liked what I've seen so far, I'm going to start using it as a glyph and icon editor for my applications and report any problems or features that come to me. I have left one feature request on SF.
All in all congratulation fantastic work. I can't wait to see the next release.

I have a side project that I would like to do based on the current status of the application. When I get some time I'll leave you a message.

Once more congratulations very well done.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 01, 2012, 08:52:08 am
Thank you very much. I'm going to check your request on sourceforce.

Maybe the Ctrl key will be useful for you when editing icons (it snaps the pen to pixel grid).

I'm not sure what you mean by your project "based the current status".
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on October 01, 2012, 09:29:05 am
Thank you very much. I'm going to check your request on sourceforce.

Maybe the Ctrl key will be useful for you when editing icons (it snaps the pen to pixel grid).

Thank you for the info I'll try it later and see how it goes, although I think that a simple rectangular brush is missing,
don't bother on my account, I'm just color editing for now.

I'm not sure what you mean by your project "based the current status".

I mean that the current status of lazpaint is enough for the needs of the project I have in mind and I don't know if any extra abilities will make it any easier or harder to use.

congrats.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 01, 2012, 09:49:15 am
Thank you for the info I'll try it later and see how it goes, although I think that a simple rectangular brush is missing,
don't bother on my account, I'm just color editing for now.
For that purpose, set brush size to 10 and use Ctrl key.

Quote
I mean that the current status of lazpaint is enough for the needs of the project I have in mind and I don't know if any extra abilities will make it any easier or harder to use.
Don't worry about that. I'm planning to keep LazPaint simplicity, even if I add new features. For layers, I'm planning to add just one little icon in the toolbar and one menu item in the View menu, and that when it's clicked the layer window appears. But if it's not clicked, everything should just work the same way.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 04, 2012, 04:17:00 am
LazPaint is realy cool. It needs a website. I only know how to do blogs...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 04, 2012, 01:40:32 pm
I was also thinking about it, but I first want to add layers, and then I will need to have some time. Maybe when layers are added, some contributor will come up to help us with the web site.  8-)

If I remember well what FabienWang told me, it is possible to host a web site on sourceforge. But it is also possible to create a domain name for that. It's not expensive.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 04, 2012, 05:13:00 pm
I was also thinking about it, but I first want to add layers, and then I will need to have some time. Maybe when layers are added, some contributor will come up to help us with the web site.  8-)

If I remember well what FabienWang told me, it is possible to host a web site on sourceforge. But it is also possible to create a domain name for that. It's not expensive.

10 U$D per year or something like that.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 04, 2012, 06:07:15 pm
Yep.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on October 15, 2012, 12:14:08 pm
@circular

just a suggestion, can you add a text outline thickness setting? or if this is already available how can i do it
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 17, 2012, 02:43:26 pm
In fact, it is not really possible because for now text is rasterized first with LCL canvas, so it's just a contour filter that makes the outline. To define an outline thickness, it is necessary first to vectorize the font or use FreeType. I am working on this on my spare time, but it's not ready yet.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on October 21, 2012, 05:18:49 pm
@circular

take your time *waits patiently*
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 21, 2012, 06:43:16 pm
Have you tried latest svn version ? (basic layer support, no undo/redo)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Sternas Stefanos on October 21, 2012, 08:17:11 pm
Guys
LazPaint (bgrabitmap 6.2) on Solaris 32/64, linux etc...

with no problems,
lab CT 3.00 (lazarus and fpc 2.7.1 svn 21-10-12)

@circular, thanks for your work...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 21, 2012, 11:06:06 pm
Cool. Thanks for testing !  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on October 22, 2012, 03:07:29 am
Have you tried latest svn version ? (basic layer support, no undo/redo)

i only downloaded this version lazpaint4.8_win32.zip
is their a link to the version with layer support?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 22, 2012, 03:41:08 am
Have you tried latest svn version ? (basic layer support, no undo/redo)

i only downloaded this version lazpaint4.8_win32.zip
is their a link to the version with layer support?

No because there are a lot of things to do as I can see, like undo/redo.

@circular, you can add 'Print' for LazPaint?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 01, 2012, 06:44:16 pm
@circular

just a suggestion, can you add a text outline thickness setting? or if this is already available how can i do it
You may be interested by that vectorized font :
http://www.lazarus.freepascal.org/index.php/topic,12390.msg106188.html#msg106188
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 05, 2012, 09:43:38 pm
New svn address : svn checkout svn://svn.code.sf.net/p/lazpaint/code/ lazpaint-code
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 18, 2012, 03:27:23 pm
Just to tell you that I've done layer support, and now I'm doing undo/redo for layers.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on November 18, 2012, 03:37:44 pm
Quote
Just to tell you that I've done layer support, and now I'm doing undo/redo for layers.
Great! Waiting for a release :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fabienwang on November 20, 2012, 12:40:38 pm
Just to tell you that I've done layer support, and now I'm doing undo/redo for layers.

Can you see the Updater in the menu ? I don't see it on my Linux x86_64.

I think it's related to the path where it searches the existing binary (i guess i don't search in the right path).

If you remember, the Updater only shows in the menu if found in the "current directory". Or, i don't know why but when i start any lazarus application, the current directory is not set to the application directory but to the ~/ .

I'll make a fix for the Updater. Do you see any other feature I could work on?

Quote
Just to tell you that I've done layer support, and now I'm doing undo/redo for layers.
Great! Waiting for a release :D

Hehe, why not just compile it? :P
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on November 20, 2012, 05:44:13 pm
Quote
Hehe, why not just compile it?
I think for LazPaint I will use it as a daily software, which means it has to be stable ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 23, 2012, 11:38:55 am
@FabienWang: Yes of course, if you see something to solve, please do.  :)

@Leledumbo: I understand, all the more so as there is no undo yet, which makes my program quite useless for now.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 26, 2012, 01:29:14 am
The release is working well.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 15, 2013, 10:33:35 pm
Layered undo is almost finished.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 17, 2013, 11:28:56 pm
New version of LazPaint (5.0) :
- layers !
- load Paint.NET files and load&save OpenRaster files
- example 3D obj files
- modifiable rectangular shapes (rectangle, ellipse, gradient, shaded shapes)
- colorize with gsba (corrected hsla)
- spinedits in color windows
- color window and filters can be applied to an empty selection (so applied only inside the selection)
- twirl center

http://sourceforge.net/projects/lazpaint/files/src/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on February 18, 2013, 12:27:00 am
attached a translation, there are some things that I can not translate because I can't test the program, and basically if I not see that working I cant translate.

Lazarus 1.1 r40315 FPC 2.6.0 i386-win32-win32/win64

Code: [Select]
D:\components\bgrabitmap\bgrabitmap\bgrablend.pas(387,17) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\components\bgrabitmap\bgrabitmap\bgrablend.pas(414,17) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\components\bgrabitmap\bgrabitmap\bgrablend.pas(448,17) Hint: Converting the operands to "Int64" before doing the multiply could prevent overflow errors.
D:\components\bgrabitmap\bgrabitmap\blendpixelinline.inc(532,38) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\components\bgrabitmap\bgrabitmap\blendpixelinline.inc(564,16) Hint: Converting the operands to "Int64" before doing the add could prevent overflow errors.
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(10,28) Error: Unknown identifier "INTTEXPOS"
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(10,29) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(24,42) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(24,54) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(37,30) Error: Unknown identifier "INTTEXPOS"
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(37,31) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(10,28) Error: Unknown identifier "INTTEXPOS"
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(10,29) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(24,42) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(24,54) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(37,30) Error: Unknown identifier "INTTEXPOS"
D:\components\bgrabitmap\bgrabitmap\lineartexscan2.inc(37,31) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(65,32) Error: Unknown identifier "TEXPOSBYZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(65,34) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(106,41) Error: Identifier not found "texPosByZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(106,53) Error: Identifier not found "texPosByZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,32) Error: Unknown identifier "INTTEXPOS"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,33) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(108,48) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(108,60) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(65,32) Error: Unknown identifier "TEXPOSBYZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(65,34) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(106,41) Error: Identifier not found "texPosByZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(106,53) Error: Identifier not found "texPosByZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,32) Error: Unknown identifier "INTTEXPOS"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,33) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(108,48) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(108,60) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(65,32) Error: Unknown identifier "TEXPOSBYZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(65,34) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(106,41) Error: Identifier not found "texPosByZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(106,53) Error: Identifier not found "texPosByZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,32) Error: Unknown identifier "INTTEXPOS"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,33) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(108,48) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(108,60) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(65,32) Error: Unknown identifier "TEXPOSBYZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(65,34) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(106,41) Error: Identifier not found "texPosByZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(106,53) Error: Identifier not found "texPosByZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,32) Error: Unknown identifier "INTTEXPOS"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,33) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(108,48) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(108,60) Error: Identifier not found "intTexPos"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(65,32) Error: Unknown identifier "TEXPOSBYZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(65,34) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(106,41) Error: Identifier not found "texPosByZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(106,53) Error: Identifier not found "texPosByZ"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,32) Error: Unknown identifier "INTTEXPOS"
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,33) Error: Assembler syntax error
D:\components\bgrabitmap\bgrabitmap\perspectivescan2.inc(68,33) Fatal: There were 50 errors compiling module, stopping
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 18, 2013, 08:04:27 am
Thanks. Ok, I need to download a 32 bit version of Lazarus to check this.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 18, 2013, 11:34:16 am
Ok it should be fixed in latest BGRABitmap (use latest version 6.8 ):
http://sourceforge.net/projects/lazpaint/files/src/

This version of LazPaint (5.0) is designed to be tested, it is not really a public release, no install is provided yet. I will publish it when I'm confident it works well on 32 bit, 64 bit, Mac and Linux.

For now, i've tested it on Windows 7 64 bit, compiled as a 64-bit binary and compiled as a 32-bit binary.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on February 18, 2013, 11:18:54 pm
Here a patch for 'cross setup' for Win32 and Win64, in one setup you get both versions. (I supposed that the update checker will be moved to lazpaint so i've not added the update_checker_x64.exe in the .iss)... also you will notice that _x64.po file is excluded, because the installed name will be always lazpaint.exe.

I've changed the build modes, adding Win32 and Win64.. remove if you has another method to create the exe.

Also the name of the application if it's 32 bit or 64 bit. "LazPaint 5.0 (32-bit)" and "LazPaint 5.0 (64-bit)" at least the user will know what is running :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 19, 2013, 12:09:59 am
Wow, thanks 8-)

I've applied the patch and replaced the zip file for version 5.0.

Now people, you can easily compile LazPaint for 32-bit or 64-bit and check it out.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on February 19, 2013, 02:23:36 am
yo circular, can you provide a compiled version of version 5.0 for windows? im noob at compiling large files like this especially with dependecies like bgracontrols and etc

EDIT:

i manage to compile it by downloading this files bgrabitmap6.8.zip and bgracontrols-2.0.6.0 alpha.zip and then extract them and double click bgrabitmappack.lpk and bgracontrols.lpk for them to be installed on LazarusIDE then proceed on compiling this lazpaint5.0_src.zip

a suggestion can you make the Layers Window default to visible?

awesome work btw thanks a lot!!! but for a lot of noobs like me out there it will be better if you provide a compiled version of LazPaint 5.0, thanks again!!!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 19, 2013, 09:49:46 am
Congratulations  :)

Thank you very much for your effort.

Well, I want first the program to be tested before I release it as a binary, because after that, it will be spread over the Internet, and I want the first version of layered LazPaint to be sufficiently stable. So please try to make the program explode !

The Layer Window is not visible by default because it is a bit complicated. I do not want to frighten users. On the other side, maybe the could think that layers cannot be used. That's why I added a button in the tool bar to show the layer window. Do you suggest that it is not obvious enough?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on February 19, 2013, 12:09:17 pm
The Layer Window is not visible by default because it is a bit complicated. I do not want to frighten users.

Paint.NET has layers defaulted to visible too so i think its safe for most people to see the layers window

That's why I added a button in the tool bar to show the layer window. Do you suggest that it is not obvious enough?

maybe adding a tooltip with text that says "Layers Window" can make it more obvious

btw if you want more feature suggestion i can suggest having text outline thickness setting, and yes the text tool also has an error it says "Access Violation", im using Windows 7 Ultimate 64-bit i compiled LazPaint 5.0 with this lazarus-1.0.6-fpc-2.6.0-win32.exe

the layers window is acting fine and nice that you added "Blending Modes" on it thats really cool  :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 20, 2013, 12:24:16 am
The Layer Window is not visible by default because it is a bit complicated. I do not want to frighten users.
Paint.NET has layers defaulted to visible too so i think its safe for most people to see the layers window
Alright, let it be visible from the beggining.

Quote
maybe adding a tooltip with text that says "Layers Window" can make it more obvious
Oh, maybe the action list replaced it, ok that's fixed.

Quote
btw if you want more feature suggestion i can suggest having text outline thickness setting
Yes, it's on my todo list

Quote
and yes the text tool also has an error it says "Access Violation", im using Windows 7 Ultimate 64-bit i compiled LazPaint 5.0 with this lazarus-1.0.6-fpc-2.6.0-win32.exe
Even with latest BGRABitmap?

Quote
the layers window is acting fine and nice that you added "Blending Modes" on it thats really cool  :D
:)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on February 20, 2013, 03:20:35 am
Quote
maybe adding a tooltip with text that says "Layers Window" can make it more obvious
Oh, maybe the action list replaced it, ok that's fixed.

nice looking forward to it

Quote
btw if you want more feature suggestion i can suggest having text outline thickness setting
Yes, it's on my todo list

thanks a lot!

Quote
and yes the text tool also has an error it says "Access Violation", im using Windows 7 Ultimate 64-bit i compiled LazPaint 5.0 with this lazarus-1.0.6-fpc-2.6.0-win32.exe
Even with latest BGRABitmap?

ye im using the following dependencies
bgrabitmap6.8.zip
bgracontrols-2.0.6.0 alpha.zip
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 20, 2013, 10:20:15 am
Alright, can you tell me where the error occurs ?

To do this, you need to :
- switch to debug mode for LazPaint (this is in the top left toolbar when you open this project)
- and to change compilation options of BGRABitmapPack :
   - open package, click Options
   - in Code generation, set Level 1 optimization (-O1) and uncheck register variables (-Or)
   - in Linking, click the first check box to generate debugger info

Then try to produce the bug, and the line should be highlighted.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 20, 2013, 03:07:41 pm
Here is version 5.1 :
https://sourceforge.net/projects/lazpaint/files/src/

- when layer is invisible, layer cannot be edited
- text tool : text alignment, pressing return key go to next line
- checking for newer version online using LNet
- safe limits for image size and undo
- less memory usage

This version seems ok for me, so tell me if there is still some change to be applied before it is published as a binary. Note that missing translations are appreciated.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 20, 2013, 04:10:10 pm
Quote
This version seems ok for me, so tell me if there is still some change to be applied before it is published as a binary
View->Layers:
Sounds reversed to me
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 20, 2013, 04:12:02 pm
I understand. The check is the current state. When you click on the menu, you change that state.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 20, 2013, 04:29:37 pm
Yes, so it should be made uniform with other windows: checked -> visible, unchecked -> invisible
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 20, 2013, 04:47:28 pm
But that's the case.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: airpas on February 20, 2013, 06:27:15 pm
good progression
just a small suggestion , if you could make the layers movements just like photoshop , the background frame should be fixed (zoom in/out  only) and the layers move over it .

the layer blending mode could be just a drop listbox so you just select instead of popup another window.

good work
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 20, 2013, 10:37:46 pm
good progression
Thanks.

Quote
just a small suggestion , if you could make the layers movements just like photoshop , the background frame should be fixed (zoom in/out  only) and the layers move over it .
I don't understand

Quote
the layer blending mode could be just a drop listbox so you just select instead of popup another window.
They are added to the combobox when they are selected in the popup window. My idea was that when you don't know what blending modes are, you can preview them. There are too much blending modes to put them automatically in the combobox to my opinion.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 21, 2013, 12:35:06 am
Quote
But that's the case.
Seems not here (fresh svn) (err... I can't take a screenshot while the menu is shown)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on February 21, 2013, 05:44:54 am
switch to debug mode for LazPaint (this is in the top left toolbar when you open this project)

i did not understand this line but i set the rest accordingly and i got this error message
assembler debug window pops up and shows this
Code: [Select]
00683D22 8b36 mov (%esi),%esi
screenshot
(http://i.imgur.com/QOHlpuE.png)
http://i.imgur.com/QOHlpuE.png

and here are more that might potentially help debugging
http://pastebin.com/raw.php?i=t1AGiEwg
http://pastebin.com/raw.php?i=WjxuXdZ8

  • Checked: layers invisible
  • Unchecked: layers visible

to me its working fine it goes like
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 21, 2013, 08:10:16 am
@j0x:

well I can't do anything with that, there's no debug info here other than pure cpu state. here is what I was talking about :
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on February 21, 2013, 11:04:30 am
@j0x:

well I can't do anything with that, there's no debug info here other than pure cpu state. here is what I was talking about :

i think i got it this time here it is screenshots below and the compiled version you given me via PM still having the error of Access Violation when i use the Text tool
http://i.imgur.com/LoDcZUx.png
http://i.imgur.com/2gImE3s.png
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 21, 2013, 04:51:17 pm
Quote
to me its working fine it goes like
Checked: layers visible
Unchecked: layers invisible
I'll look at the code I have. Btw, the source I have is of r505. Does it match with this 5.1 we're talking about?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: airpas on February 21, 2013, 05:23:41 pm
are you going to do some optimization ? . because its terribly slow compared with other painting software
i think its because of the compiler !!! . just thought
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 21, 2013, 10:23:09 pm
@j0x:

well I can't do anything with that, there's no debug info here other than pure cpu state. here is what I was talking about :

i think i got it this time here it is screenshots below and the compiled version you given me via PM still having the error of Access Violation when i use the Text tool
http://i.imgur.com/LoDcZUx.png
http://i.imgur.com/2gImE3s.png
Thanks.

Try adding at line 235 those lines :
Code: [Select]
  if fx.TextMask = nil then
  begin
    fx.Free;
    FxFont.Free;
    exit;
  end;
(before alphaMax := 0 in BGRATextFX)

EDIT: What is the call stack when this bug happens ? (View > Debug Window > Call Stack, CTRL-ALT-S)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 21, 2013, 10:25:39 pm
are you going to do some optimization ? . because its terribly slow compared with other painting software
i think its because of the compiler !!! . just thought
I would like to do some optimizations later, but first I would like to make it work.

By the way, everything is not slow, that's not true. But some things are. What precisely are you thinking about?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on February 22, 2013, 12:12:48 am
maybe it is slow as image viewer?

I can load 3000x3000 px images with Picasa really fast, also with the Windows image viewer. And takes really a lot of seconds with LazPaint. Why? Simple. Because they don't load the bitmap fully (try loading a big picture and quickly zooming in Picasa, you'll see what I say), they load a part of the bitmap, usually less than 1000x1000 px (or less), a fast read, something similar that cell phones do: http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

of course that's for image viewing, not editing.. (I think)

I recently downloaded Gimp 2, I need to compare both programs speed in similar situations.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 22, 2013, 12:57:56 am
Basically image loading relies on FreePascal image loading, which can be slow.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on February 22, 2013, 03:19:45 am
Also seems hard to implement a way to load from png / jpg / bmp directly to BGRABitmap, I've reading the 'most simple' that's bmp and is a headache :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on February 22, 2013, 07:41:47 am
Try adding at line 235 those lines :
Code: [Select]
  if fx.TextMask = nil then
  begin
    fx.Free;
    FxFont.Free;
    exit;
  end;
(before alphaMax := 0 in BGRATextFX)

it works! the the text tool has no Access Violation error now

EDIT: What is the call stack when this bug happens ? (View > Debug Window > Call Stack, CTRL-ALT-S)

here it is and screenshot on attachment http://pastebin.com/raw.php?i=31tYqE20
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 22, 2013, 09:26:01 am
Ok I understand why this happens.

So it will be 5.1 with new BGRABitmap version (6.9.1). Thanks to all.

Can someone make some Linux version ?
https://sourceforge.net/projects/lazpaint/files/bin/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: airpas on February 22, 2013, 03:24:28 pm
i just download lazpaint5.1_setup_win32 from SF and its really faster than my compiled one from source code !!!!
so have you add some options to the compiler ?






Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 22, 2013, 03:30:13 pm
Just usual optimizations : level 3, register and no debug info
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on February 22, 2013, 06:15:34 pm
Quote
I'll look at the code I have. Btw, the source I have is of r505. Does it match with this 5.1 we're talking about?
Seems like Qt specific issue (recompile with GTK2 and everything works as expected), though I have no idea which code causes the bug in my case.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 22, 2013, 07:49:16 pm
Here is a new version LazPaint 5.2 with minors fixes :
- can save OpenRaster files
- refresh screen fixes on loading

http://sourceforge.net/projects/lazpaint/files/bin/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 23, 2013, 11:34:53 am
Here are videos :
- Loading OpenRaster from MyPaint : http://www.youtube.com/watch?v=KUJUeIbpYDo&list=PLC5C5CAB111B5D9DA&index=7
- Saving OpenRaster to Krita : http://www.youtube.com/watch?v=FFEZpl15Rb4&list=PLC5C5CAB111B5D9DA
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on February 23, 2013, 06:23:20 pm
Thanks, it's getting stronger =)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 24, 2013, 06:38:22 pm
Yeah, the fact that there was no layer was the main gap between LazPaint and Paint.NET or Krita.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 24, 2013, 07:13:58 pm
New version of LazPaint 5.3 with easier layer handling.

- move layer and rotate layer only selection the bounding rectangle
- perspective transform icon in layer window (you can hold Shift or Alt to scale)

http://sourceforge.net/projects/lazpaint/files/bin/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 25, 2013, 11:25:58 am
Here is a video tutorial on how to use layers to extract an object from an image and put it multiple times :
http://www.youtube.com/watch?v=Hxinfs6ziFc
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 25, 2013, 11:04:19 pm
Linux version compiled for LazPaint 5.3 !
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 26, 2013, 08:43:33 pm
New version of LazPaint (5.4) with :
- reorganized code
- bug fixes with layers
- better layer transform
- more filter preview
- filter window for sharpen with amount
- bug fix when loading LZP files

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

It needs latest BGRABitmap (6.9.5).

Only the source code is released for now. If you can test it and make binaries for Linux or Mac, it would be welcomed as I work only with Windows. If you find some bugs, please tell me.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CaptBill on February 26, 2013, 09:21:11 pm
Here is a video tutorial on how to use layers to extract an object from an image and put it multiple times :
http://www.youtube.com/watch?v=Hxinfs6ziFc

Man, that is awesome.
Is Lazpaint really on par with Paint.net ?

That is fantastic. Great work.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 26, 2013, 11:29:45 pm
Thanks.  :)

Yes, there are some things better in LazPaint and some things better in Paint.NET.

There is still room for improvement for LazPaint, but I will try first to finalize with LazPaint 5.4, to get a stable and usable version of layers. I hope to finish tomorrow.

Again, if you find any bug, please tell me before I publish it.

I find someone to make MacOS binaries and someone to make Linux binaries, so I suppose I will have all of them (Win32, Win64, MacOS32, Linux32)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 27, 2013, 09:16:23 pm
New version of LazPaint 5.4 officially released !
- more stable
- file association with LZP (LazPaint files) and ORA (OpenRaster)
- better layer support
- reorganized code
- ask to save file if modified when loading/new image
- keyboard shortcuts for tools
- SPACE key to go temporarily in move tool
- perspective repeat option (so you can do a plane in 3D with repeating texture)
- texture opacity
- yet another pen cursor
- zoom to any percentage (click on percentage to change it)
- sharpen filter with amount
- layer move fix (when moving more than one place)
- reload image

Binaries for Win32 and Win64 :
http://sourceforge.net/projects/lazpaint/files/bin/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on March 02, 2013, 05:14:46 pm
I've uploaded pure binaries for i386-linux (gtk2 and qt interface). Do you think I should UPX them first?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 02, 2013, 07:10:59 pm
Thanks.

Well, it seems that they are bigger than Windows version.

But more important, you don't need to include the update_checker. It is not used anymore, because it is included.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on March 02, 2013, 07:41:05 pm
Quote
But more important, you don't need to include the update_checker. It is not used anymore, because it is included.
Oh, alright, I'll reupload with update_checker removed. Where's the update functionality then? Is it automatically checked on start?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 02, 2013, 08:18:05 pm
Yep, and in case the version has changed, it shows a dialog box. It is saved in the configuration, so that it is not shown the next time.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 04, 2013, 07:10:06 pm
New version of LazPaint (5.5) with :
- layer duplicate bug fix
- blur computed in thread so that user has a non blocking preview
- optimized filters when applied on an empty selection
- grid tool update fix when moving a point without deformation
- more interface and translation compatibility
- 2 new filters : phong filter with a map, filter with any arbitrary mathematical function

http://sourceforge.net/projects/lazpaint/files/bin/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 04, 2013, 07:19:21 pm
Videos :
- Drawing fire : http://www.youtube.com/watch?v=yWgo0fcdOSg
- Drawing a lightning orb : http://www.youtube.com/watch?v=69cHd5W-Zyg
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 05, 2013, 07:06:37 pm
New video :
- Neon effect : http://www.youtube.com/watch?v=1rtHSPAUDnA
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 06, 2013, 02:32:00 pm
Binaries for MacOSX are available :
http://sourceforge.net/projects/lazpaint/files/bin/lazpaint5.5-osx32bits.zip
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: airpas on March 07, 2013, 10:01:42 am
i hope you will add some kind of bursh style like this
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 07, 2013, 07:37:45 pm
In fact I'm wondering how to do brushes. If the brush is some image that is drawn at some point, then what should be done when the cursor moves ? Drawing the same image for each pixel ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: airpas on March 07, 2013, 10:28:03 pm
i mean the airbrush , which would be just a circle with a certain gaussian blur value .
the problem is when you draw with a fast motion you will get a separate circles .

i'll look into gimp source maybe i'll find some algos
 
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 07, 2013, 11:18:37 pm
Yes, that's one of the issues.

Thanks.

I was thinking about drawing a linear gradiant along the line joining two consecutive points, but that's not so simple.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 07, 2013, 11:57:12 pm
New version of LazPaint (5.6) with :
- spline/polygon edition
- 'easy bezier' style for drawing curve
- color can be changed while the object is drawn
- auto-update languages online
- ask to save when loading recent file
- layer bug fix for selection and texture editing
- update fix when inverting selection
- phong light vertical position fix

http://sourceforge.net/projects/lazpaint/files/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on March 08, 2013, 03:16:14 am
Hi, you'll need to update LazPaint, sorry :)

Use BCPanel instead BGRAPanel in ULoading.. and maybe other..
Check this: http://lazarus.freepascal.org/index.php/topic,12411.msg116013/topicseen.html#new

Outdated components are no longer supported. As Dibo want to be a months ago, finally is here :)

Some will hate me, but the new components are great.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 08, 2013, 10:32:38 am
Alright. I understand.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 08, 2013, 04:34:13 pm
New tutorial on how to make realistic grass :
http://www.youtube.com/watch?v=BkZMHf-Efig
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 13, 2013, 11:22:44 am
Tutorial on how to extract with spline selection and make a glow effect :
http://www.youtube.com/watch?v=Lewg3iYkln8
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 14, 2013, 05:49:10 pm
Hey people,

I think that version 5.6 of LazPaint is sufficiently stable. So it is a milestone in the development of LazPaint, let's say the layer milestone.

Thank you all very much for your support. I would probably not have done all this without you all.

 :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on March 14, 2013, 05:51:56 pm
Great job circular, thank you for your hard work I especially enjoy your tutorials a lot.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 14, 2013, 06:01:41 pm
Happy to hear that you liked the tutorials  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on March 14, 2013, 06:19:27 pm
Congrats!

What you can do with this attached thing :) ?

For now is pure Inkscape, but I think that you can do something with it. 8-)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 14, 2013, 06:56:04 pm
@taazz:

I've added resulting images in LZP format in tutorial videos (some link below)

@lainz:

Ok, just wait a minute.

EDIT : here is your drawing with blue fire  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on March 14, 2013, 09:11:56 pm
 :o wow LazPaint is cool
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 14, 2013, 11:02:56 pm
What I did :
- load the image into LazPaint
- duplicate the layer
- apply contour filter
- negative
- motion blur 50, vertical and oriented
- duplicate this layer
- fast blur 50
- adjust lightness
- blend mode : lighten
- merge layer
- new layer with perlin noise (twice)
- top layer with overlay blend mode
- merge layer
- blend mode : lighten
- colorize
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on March 16, 2013, 06:19:50 pm
patch using BCButton and BCPanel in LazPaint and test 3d
Download it: http://db.tt/sxbbbuGs

pd: I get some errors in 3d test and some others in canvas test, lazarus 32 bits.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 17, 2013, 06:12:25 pm
Patch applied.

Can you be more specific about the errors you get?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on March 17, 2013, 06:39:45 pm
BGRATutorial3D when I click 'ex4' there is a 'run error(3)' 'Invalid FileName'.

TestCanvas2D when I change to '2' there is a 'run error(201)' 'Range check error'.; '4', '10', '17' and '19' the same.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 17, 2013, 07:01:56 pm
BGRATutorial3D when I click 'ex4' there is a 'run error(3)' 'Invalid FileName'.
Ok that's always the same error with the obj directory. I added a workaround on subversion and a more understandable error message.

Quote
TestCanvas2D when I change to '2' there is a 'run error(201)' 'Range check error'.; '4', '10', '17' and '19' the same.
Thanks, yes, this should not be triggered. I've added "and $ffff" on subversion.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 23, 2013, 09:14:53 pm
I've updated the source code in LazPaint 5.6 zip file to work with latest BGRAControls :
http://sourceforge.net/projects/lazpaint/files/src/

Can someone make MacOS X binaries for version 5.6 ? You can look at binaries for version 5.5 to know how the archives should be organized :
https://sourceforge.net/projects/lazpaint/files/bin/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: TurboRascal on August 20, 2013, 09:42:40 pm
I was wondering, are there any plans for printer and scanner support?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 31, 2013, 09:24:24 am
Seems a good idea however well the thing is that the development is stopped for now. Of course it can continue if other people participate (with subversion patches). Personally I switched to other things and don't know when I'll continue. But the roadmap is pretty well defined:
- brushes, digital tablets
- printer, scanner  ;)
- http://graphicssoft.about.com/od/freesoftware/fr/lazpaint.htm
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: chymax3m on September 20, 2013, 09:15:17 am
Hi everybody! After starting LazPaint 5.6 met an error:
Unable to open file
"C:\Users\????\AppData\Local\lazpaint\lazpaint.nl.po"

Is this because my user name written in Cyrillic (Russian)? Could You fix It? because it appears every time i run LazPaint?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 10, 2013, 01:19:23 pm
I just thought about it: you can use the portable version instead, which saves the configuration locally (in this case you cannot put the program in Program files folder of latest versions of Windows, but in another folder like C:\LazPaint or on a USB key).

http://framakey.org/Portables/LazPaintPortable
http://www.winpenpack.com/en/download.php?view.1335
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: TurboRascal on November 21, 2013, 11:28:03 pm
Seems a good idea however well the thing is that the development is stopped for now.
...
- printer, scanner  ;)

That's unfortunate, this is one of "killer programs" made in Lazarus... :(

The image manipulation abilities already offer a decent alternative to firing up PS or GIMP except for extremely complex stuff. If it only had printer and scanner support, it would be a complete alternative to Paint.NET and similar.

I'd love if I could jump in and help, but I'm no good at graphics and multimedia programming. :-[ I also have no time to learn it since for now I must focus heavily on databases and other ERP stuff...  :-\
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on April 08, 2014, 04:51:34 am
Hi,

I see you are adding more formats to LazPaint, now you can manage File Associations from a lazarus program easy, if you want to, instead of using inno setup (that's good), check this wiki article:

http://wiki.lazarus.freepascal.org/FileAssociation

You have seen greenfish icon editor pro? Is open source and its made in lazarus
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 08, 2014, 11:38:20 pm
Oh that's interesting.

I also received a feedback about the file associations, that it would be better to opt out by default for the file assocations when the program is installed.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on April 09, 2014, 01:37:07 am
Yeah sometimes you press next> next> (and not read) and all is changed and well.. problems!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 02, 2014, 08:08:25 pm
The next version of BGRABitmap is coming. It is not completely finished yet but if you can help me test it, I would be happy.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 02, 2014, 09:28:34 pm
The next new version of LazPaint will be 6.0. It uses BGRABitmap 7.4.

New features for colors (menu Colors)
- curve adujstments
- posterize
- complementary colors
- easier brightness/contrast
- in the color window, there is now displayed the hexadecimal value and the CSS name. you can click on it to enter your own hexadecimal value or CSS name

New features for reading files (menu File)
- image browser with thumbnails (File>Open), it also displays the recent directories
- preview of new image proportions (File>New)
- texture mapping on 3d object (File>Import 3d object)
- reading PSD (flattened photoshop)
- reading TGA and TIFF
- reading linux formats XPM, XWD
- writing TGA and TIFF

New features for tools
- when drawing curves, it is possible to specify to draw angles/curves or use autodetection (Tool > Curve, Select > Select curve)
- the eraser can be used to soften an image (in the toolbar, after erase opacity)
- the key Escape can be used to cancel current drawing
- the text tool allows the cursor to move in the current line, and to select/copy/paste text

New features for image handling
- little preview for canvas size, repeat and resample

Other changes
- better handling of keys, correction of bug preventing to use +/- keys to zoom
- better rendering of icons on Linux (using TBGRAImageList)
- better antialiasing of the selection
- optimization of the rendering
- faster undo/redo
- custom blur is now threaded (so it does not lock the program for a big image/a big mask)
- eraser width is now independent from pen width (and by default bigger)
- new set of icons for layer tools
- UTF8 filenames are better handled
- top most window are better handled
- file assocations will be unchecked by default in the installer

Features not added yet
- layer rotation is not implemented
- no feature to print yet

I am testing it on a Windows 32-bit. If you have Win64, Linux or MacOS, please give me some feedback on how it runs on your computer.

To compile you will need BGRAControls and BGRABitmap. LNet is optional. If you remove it from the project, then be sure to remove $DEFINE LAZPAINT_USE_LNET from uonline.pas.

The test version is number 5.9. It is not a release. Here are the download links of the source code:
http://sourceforge.net/projects/lazpaint/files/src/lazpaint5.9_src.zip/download
http://sourceforge.net/projects/lazpaint/files/src/bgrabitmap7.4.zip/download
http://sourceforge.net/projects/bgra-controls/files/bgra-controls-3.0/bgra-controls-3.2-20140421.7z/download
http://sourceforge.net/projects/lazpaint/files/src/inet0.6.6.zip/download

Dependencies:
- LazPaint depends on BGRAControls, BGRABitmap and LNetVisual.
- BGRAControls depends on BGRABitmap.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 08, 2014, 03:32:47 pm
Hi,

I've already tested the new file open explorer! Cool.

Windows x64

- Well first I got a memory leak, something in uonline.pas, but I don't know if this is a bug in lazpaint or in lnet. (see the picture attached).

- In the layer window, the button rotate layer works? Or I don't know how to use it..

- Filter > Pixelate crashes LazPaint (win64)

Code: [Select]
SYSTEM_MOVE$formal$formal$INT64
0000000000403500 4c89c0                   mov    %r8,%rax
0000000000403503 4829d1                   sub    %rdx,%rcx
0000000000403506 0f8491000000             je     0x40359d <SYSTEM_MOVE$formal$formal$INT64+157>
000000000040350C 7309                     jae    0x403517 <SYSTEM_MOVE$formal$formal$INT64+23>
000000000040350E 4801c8                   add    %rcx,%rax
0000000000403511 0f826d010000             jb     0x403684 <SYSTEM_MOVE$formal$formal$INT64+388>
0000000000403517 4983f808                 cmp    $0x8,%r8
000000000040351B 0f8c63000000             jl     0x403584 <SYSTEM_MOVE$formal$formal$INT64+132>
0000000000403521 f6c207                   test   $0x7,%dl
0000000000403524 7437                     je     0x40355d <SYSTEM_MOVE$formal$formal$INT64+93>
0000000000403526 f6c201                   test   $0x1,%dl
0000000000403529 740c                     je     0x403537 <SYSTEM_MOVE$formal$formal$INT64+55>
000000000040352B 8a0411                   mov    (%rcx,%rdx,1),%al
000000000040352E 49ffc8                   dec    %r8
0000000000403531 8802                     mov    %al,(%rdx)
0000000000403533 4883c201                 add    $0x1,%rdx
0000000000403537 f6c202                   test   $0x2,%dl
000000000040353A 740f                     je     0x40354b <SYSTEM_MOVE$formal$formal$INT64+75>
000000000040353C 668b0411                 mov    (%rcx,%rdx,1),%ax
0000000000403540 4983e802                 sub    $0x2,%r8
0000000000403544 668902                   mov    %ax,(%rdx)
0000000000403547 4883c202                 add    $0x2,%rdx
000000000040354B f6c204                   test   $0x4,%dl
000000000040354E 740d                     je     0x40355d <SYSTEM_MOVE$formal$formal$INT64+93>
0000000000403550 8b0411                   mov    (%rcx,%rdx,1),%eax
0000000000403553 4983e804                 sub    $0x4,%r8
0000000000403557 8902                     mov    %eax,(%rdx)
0000000000403559 4883c204                 add    $0x4,%rdx
000000000040355D 4d89c1                   mov    %r8,%r9
0000000000403560 49c1e905                 shr    $0x5,%r9
0000000000403564 7538                     jne    0x40359e <SYSTEM_MOVE$formal$formal$INT64+158>
0000000000403566 4d89c1                   mov    %r8,%r9
0000000000403569 49c1e903                 shr    $0x3,%r9
000000000040356D 7415                     je     0x403584 <SYSTEM_MOVE$formal$formal$INT64+132>
000000000040356F 90                       nop
0000000000403570 488b0411                 mov    (%rcx,%rdx,1),%rax
0000000000403574 488902                   mov    %rax,(%rdx)
0000000000403577 4883c208                 add    $0x8,%rdx
000000000040357B 49ffc9                   dec    %r9
000000000040357E 75f0                     jne    0x403570 <SYSTEM_MOVE$formal$formal$INT64+112>
0000000000403580 4983e007                 and    $0x7,%r8
0000000000403584 4d85c0                   test   %r8,%r8
0000000000403587 7e14                     jle    0x40359d <SYSTEM_MOVE$formal$formal$INT64+157>
0000000000403589 66666690                 data32 data32 xchg %ax,%ax
000000000040358D 666690                   data32 xchg %ax,%ax
0000000000403590 8a0411                   mov    (%rcx,%rdx,1),%al
0000000000403593 8802                     mov    %al,(%rdx)
0000000000403595 48ffc2                   inc    %rdx
0000000000403598 49ffc8                   dec    %r8
000000000040359B 75f3                     jne    0x403590 <SYSTEM_MOVE$formal$formal$INT64+144>
000000000040359D c3                       retq   
000000000040359E 4981f900200000           cmp    $0x2000,%r9
00000000004035A5 7209                     jb     0x4035b0 <SYSTEM_MOVE$formal$formal$INT64+176>
00000000004035A7 4881f900100000           cmp    $0x1000,%rcx
00000000004035AE 7333                     jae    0x4035e3 <SYSTEM_MOVE$formal$formal$INT64+227>
00000000004035B0 4883c220                 add    $0x20,%rdx
00000000004035B4 488b4411e0               mov    -0x20(%rcx,%rdx,1),%rax
<<< the last line

( BTW I don't have bitmaps of more of 4GB, at least nowdays .-. )

Debug:
With the new Lazarus 1.2 now we can debug x64 applications installing the tools. Add a 'Debug x64' compilation mode.

Other:

I know that there is available custom blur, you can try to add a shortcut for something called 'bokeh blur'? Basically is how blur is the most nice blur ever.

When editing a curve:
-- when curve is done but is still curve, no bitmap, allow to change the type of node (something like clic the node and press a key or something like that..)
-- if you double click add a new node.
-- if you double click and 'delete' toggle button is activated, delete a node.
-- Keep as 'curve layer' or something instead of making it bitmap.

Things that works:

Color features: OK, curves are great
Reading files: OK, 3D is faster than photoshop, and has best quality!
New features for tools: OK, awesome! Is easier than Inkscape and CorelDRAW / Illustrator to draw "Easy Bézier" - something like b-spline? You can add that tool as plugin in Illustrator hehe, millons of people will buy it, oh what is free in LazPaint! Export path as SVG will be the future?
The erazer has that blurry thing! + and - shortctus: cool for notebooks that does not have the middle mouse button.
Image handling: OK

Well now that I can compare with photoshop:
- The preview of all blend operations in one window is only available in lazpaint
- All the layer shortcuts to flip are cool
- It's amazing the speed improvement. And the whole LazPaint is better than ever.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 08, 2014, 08:26:40 pm
Thanks 007!  :)

Windows 64
- About the memory leak, it is a bug in LNet, however that has no consequence.
- The rotate layer is not implemented yet.
- For the pixelate crash, it would help me to have the line of code where it crashes (the first entry in the stack trace)

About the debug in 64, I am not sure I can add it with my 32 bit windows, but I will have a look. If you can send me an updated project file with this mode, I can simply replace the current one.

About bokeh blur, it is a good idea. The current blur system does not produce such blur, even if "disk blur" is a bit like that.

Curve
- you can change the type of node by pressing one of the keys S(pline) / X(angle) / A(utomatic). I guess I can add that clicking a node would do that. However clicking is also used to move points so that may be confusing.
- adding and removing node is a good idea
- keep as a curve layer, well, good idea too, but that implies a lot of things

About color curves, yes it is quite good now.  :)

About SVG, well yes, that could be an improvement, with a new version of BGRABitmap supporting natively SVG stuff. I am not sure however how to connect this with FPVectorial.

About doing a plugin for illustrator, lol well you are right, theoretically I could become rich :)

Thanks again for the feedback!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 09, 2014, 07:53:35 pm
In fact you will become rich :) don't forget the old 007 hehe

The debugger doesn't work (in BGRABitmapPack i've changed the settings and recompiled, no idea) but i've debugged it by hand

The problem is in BGRAResample.pas
Code: [Select]
procedure StretchPutImage(bmp: TBGRACustomBitmap; NewWidth, NewHeight: integer;
  dest: TBGRACustomBitmap; OffsetX, OffsetY: Integer; ADrawMode: TDrawMode; AOpacity: byte);

In the first iteration of
Code: [Select]
  for y_dest := targetRect.Top to targetRect.Bottom - 1 do
  begin     

Somewhat here
Code: [Select]
begin
      if tempData = nil then
        move((dest.ScanLine[y_dest-1+OffsetY]+OffsetX+targetRect.Left)^,(dest.ScanLine[y_dest+OffsetY]+OffsetX+targetRect.Left)^,(targetRect.Right-targetRect.Left)*sizeof(TBGRAPenStyle))
      else
        PutPixels(dest.ScanLine[y_dest+OffsetY]+OffsetX+targetRect.Left,tempData,targetRect.right-targetRect.left,ADrawMode,AOpacity);
    end

The assembler window is the same as I put you before. SYSTEM_MOVE$formal$formal$INT64

So I think that this is the line
Code: [Select]
move((dest.ScanLine[y_dest-1+OffsetY]+OffsetX+targetRect.Left)^,(dest.ScanLine[y_dest+OffsetY]+OffsetX+targetRect.Left)^,(targetRect.Right-targetRect.Left)*sizeof(TBGRAPenStyle))
In the x86_64.inc is defined Move
Code: [Select]
procedure Move(const source;var dest;count:SizeInt);[public, alias: 'FPC_MOVE'];assembler;nostackframe;
{ Linux: rdi source, rsi dest, rdx count
  win64: rcx source, rdx dest, r8 count }
asm
{$ifndef win64}
    mov    %rdx, %r8
    mov    %rsi, %rdx
    mov    %rdi, %rcx
{$endif win64}

...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 09, 2014, 08:23:05 pm
Thank you very much. I guess I know what the problem is. There is TBGRAPenStyle instead of TBGRAPixel. I guess I did not check enough what Intellisense proposed here!!

It is fixed in BGRABitmap 7.5.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CaptBill on May 12, 2014, 06:45:28 pm
Hi Circular,
Excellent work.

I have installed it to TinyCore no problems. (fpc2.4.2/laz1_0_8). The file browser shows as full screen and the list box fields are overlapping/not wide enough but only after minimizing the dialog. Also, it crashes when I press the far left button (show icons button?)

I had no luck so far with win7 64 CodeTyphon installation. Seems to be a issue with CodeTyphon though. The 'Small IDE' doesn't want to install new components to the pallet for some reason. ??

I played around with the 'layers' feature. Really nice. Seems to work great.

Cheers

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 20, 2014, 12:42:56 pm
Thank you CaptBill.

Here is a new test version 5.9b of LazPaint.

New features
- Print dialog
- Noise filter
- Ability to edit curve when you draw it (add/remove points)
- Better blend op dialog, button to select blend op in layer stack
- Rotate layer tool

Optimisations
- Move layer tool optimisation
- Optimisation of selection rotation

Linux fixes
- Browse image fix for Linux
- Toolbar height fix for Linux (spinedits are a bit bigger)

Links:
http://sourceforge.net/projects/lazpaint/files/src/lazpaint5.9b_src.zip/download
http://sourceforge.net/projects/lazpaint/files/src/bgrabitmap7.5.zip/download
http://sourceforge.net/projects/bgra-controls/files/bgra-controls-3.0/bgra-controls-3.2-20140421.7z/download
http://sourceforge.net/projects/lazpaint/files/src/inet0.6.6.zip/download

Possible remaining issues:
- problem of update of the screen, the image being displayed not up-to-date after doing colorize or changing blend mode

Regards

Note: if you would like to help with the translation, please use the language files of this test version (5.9b) as it contains some new labels. Thanks
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on May 29, 2014, 10:23:23 am
I have attached a patch, adding a percentage option for the resize dialogue, I functionality I missed. Also, the patch enlarges two labels, which are too short for my language.
Something else I miss are scrollbars in the image panel.


if i can suggest you for the next steps:
 + multiple images open in tabs?
This is needed, in order to interact with several image in the same time.


Anyway, a useful feature will be a panel with images for processing, or in details:
Several files are added to the panel (with a file open menu or drag and drop). In the panel there shall be Prev and Next button. When the Next button is pressed current image closes and the next one is open. No memory will be wasted for opening multiple images at the same time, and there will be no effort for opening each file separately.
If you accept contributions, I might check if I can do something for that feature, which I need for processing scanned multipage documents.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 29, 2014, 12:52:07 pm
Thank you. I applied your patch. I modified a bit so that the ratio is also kept with percentages. I also added code to prevent de size from being zero (1% of 20 is zero for example).

I am happy to have your contributions.  :)

About scrollbars, I take a note of this.

About having a panel for image processing, that is a good idea. It would be a light alternative to the tabs and multiple images opened at the same time.

There is some refactoring to do here. I guess what would be needed is a TMainFormLayout class that handles the parts of the main form, and return the coordinates of those. For now, there is TMainFormMenu that handles the main menu and the toolbar, and it only returns the toolbar height.

This layout class would get the Resize event from the main form, use the TMainFormMenu class, and would recturn the area for the picture. There are two different modes: with a PaintBox or without PaintBox. If there is a PaintBox, it is used to render the picture. If there is none, the picture is rendered on the form.

Toolbars position are computed with custom code, so it is not possible to use the Anchors or Align property. So the layout class need to handle that.

I can take care of the layout if you like, so that you can focus on the panel you would like to add.

However if you would like to do that layout too, tell me.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: airpas on May 29, 2014, 01:41:44 pm
is it possible to move a layer over another one  using arrow keys , and not the cursor
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on May 29, 2014, 02:06:55 pm
Here are some more feature I miss in LazPaint.
1. Selected areas, layers, drawing (with pen, etc) etc. shall be draggable with the arrow keys, too, not only with the mouse. Maybe it will be better if some hot keys are enabled, for example:
Left arrow- drag 1 pixel left
Left arrow+ Ctrl- drag 10 pixel left.
Left arrow + Alt- drag 5% of the image size left (sometimes 10 pixel are nothing, sometimes they are too much, depending on the size of the image).
2.  I am used to using GIMP, though I do not like latest versions. That is why I was searching for the "Open as new layer" in the file menu. Finally I found it in the layers panel, but I still think it should be available in the File menu.

3. Alpha channel cannot be disabled for the image editing session.
 

About having a panel for image processing, that is a good idea. It would be a light alternative to the tabs and multiple images opened at the same time.

 

That is not an absolute alternative, since if I need to copy from one image into another, I need both images open, but for other purposes it is better.
 


I applied your patch. I modified a bit so that the ratio is also kept with percentages. I also added code to prevent de size from being zero (1% of 20 is zero for example).
 
I will check changes when I update the SVN. Percentage is needed in the Canvas resize dialogue, too, I will check what I can do.

 

I can take care of the layout if you like, so that you can focus on the panel you would like to add.

However if you would like to do that layout too, tell me.
I suppose I won't be able to start before say 10 of June.
There is also a problem, that LazPaint does not show the default extension when saving images, I would take care for that, too.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 29, 2014, 10:35:15 pm
1. Selected areas, layers, drawing (with pen, etc) etc. shall be draggable with the arrow keys, too, not only with the mouse. Maybe it will be better if some hot keys are enabled, for example:
Left arrow- drag 1 pixel left
Left arrow+ Ctrl- drag 10 pixel left.
Left arrow + Alt- drag 5% of the image size left (sometimes 10 pixel are nothing, sometimes they are too much, depending on the size of the image).
Good idea.

Quote
2.  I am used to using GIMP, though I do not like latest versions. That is why I was searching for the "Open as new layer" in the file menu. Finally I found it in the layers panel, but I still think it should be available in the File menu.
This is an easy one. I have done it.

Quote

About having a panel for image processing, that is a good idea. It would be a light alternative to the tabs and multiple images opened at the same time.
 

That is not an absolute alternative, since if I need to copy from one image into another, I need both images open, but for other purposes it is better.
Well the thing is that tabs is out of the scope of version 6.0, as I would like to publish it soon, lets say in June or July.

Quote
I will check changes when I update the SVN. Percentage is needed in the Canvas resize dialogue, too, I will check what I can do.
Ok.

Quote

I can take care of the layout if you like, so that you can focus on the panel you would like to add.

However if you would like to do that layout too, tell me.
I suppose I won't be able to start before say 10 of June.
Ok. I may have done it in the meatime.

Quote
There is also a problem, that LazPaint does not show the default extension when saving images, I would take care for that, too.
Ok.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 04, 2014, 07:31:10 pm
Quote

I can take care of the layout if you like, so that you can focus on the panel you would like to add.

However if you would like to do that layout too, tell me.
I suppose I won't be able to start before say 10 of June.
Ok. I may have done it in the meatime.
 
I have started working slowly on it.

There is a boring issue- when I close the SVN version of LazPaint it shows some (probably debug) mesages. How am I to disable them?
Speaking of layouts , am I the only one who hates the scattered Gimpish/Lazarusish style of panels everywhere and over everything? :'(


Edit: I just came upon a bug under WinXp. In the new file open dialog, I tried to paste a string (a path actually), but pasting does not work, neither with ctrl+c, nor with rightclick->popup menu.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 04, 2014, 11:10:48 pm
Ah ok it is not really a bug but a feature request. How do you propose pasting to work? What menu would you propose?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 05, 2014, 10:09:51 am


Maybe you did not understand what I meant.
When I do File/Open picture I get a dialogue to select a picture. There is a field, containing the path to the currently viewed folder, i.e. c:\
But I want to paste inside the address of another folder, i.e. c:\Document ...\blabla\...\dyrybyry\..\images\since I have this folder open in the commander and I just copy the path from there.
But pasting does not work.
If I am still not clear, I will upload a picture, unfortunately it might take hours.

You said nothing about that:
Quote
There is a boring issue- when I close the SVN version of LazPaint it shows some (probably debug) mesages. How am I to disable them?
It shows me plenty of messages, so I have to kill application upon exit :-\



Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 05, 2014, 11:32:33 am
Ah I understand about the path. You are talking only about the textbox that contains the path. Yes it would be possible to make it editable.

About the debug messages, normally there is just one message, you just need to press ok. If there are more, there may be some memory leak. Can you post a screenshot of the first message box?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 05, 2014, 03:41:38 pm
I have added a new PO file and I am translating it, probably something gets messed because of that, since most messages are related with resource strings or something like that.
I have no idea how many messages are shown, I never pressed okay more than 5 times, after that I just kill the app.
If you consider it useful, I could pack the whole app folder and send it to you.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 05, 2014, 08:32:21 pm
Well I don't think the whole thing would be much more useful than a screenshot.

What happens if you start with a fresh directory, do you get the same error?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 10, 2014, 10:08:13 am
What happens if you start with a fresh directory, do you get the same error?
I copied the exe in the Programs Files folder (where normal version was installed) and I got a single message display.
In the svn version most messages are generated from translations.pas and defaulttanslator.pas.
Anyway, what I need is to know which line to comment to prevent this msgbox(es) form appearing), I do not understand what they are saying me.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 18, 2014, 01:01:03 pm
a useful feature will be a panel with images for processing, or in details:
Several files are added to the panel (with a file open menu or drag and drop). In the panel there shall be Prev and Next button. When the Next button is pressed current image closes and the next one is open. No memory will be wasted for opening multiple images at the same time, and there will be no effort for opening each file separately.
A patch with this functionality is attached.
There is a problem- when the window is closed with a click on the + button, it needs to be enabled twice in order to be shown again.
I hope circular won't have troubles fixing it.


Edit: I just found a bug. If a image is edited but unsaved, when opening a new image from the imagelist window a dialog should appear, asking if the file should be saved, but it does not. I will try to fix in the near days.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 19, 2014, 05:59:34 pm
Thanks I will have a look at it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Fahmy Rofiq on June 20, 2014, 12:18:14 pm
Today I compiled Lazpaint trunk (5.9), it's great application. :)
BTW: Rotate layer is slow for big images. Please improve this, this is really useful feature. I always use rotation when editing scanned images.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: BigChimp on June 20, 2014, 12:43:40 pm
Please improve this, this is really useful feature.
Would be nice if you could submit a patch or code with performance improvements ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Fahmy Rofiq on June 20, 2014, 12:58:45 pm
Would be nice if you could submit a patch or code with performance improvements ;)
I'm just a noob here. :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 20, 2014, 02:27:22 pm
circular, please assign a shortcut key for Image/Remove Transparency/Clear alpha channel and set background.
Yet there another bug- when the application language is changed, it restarts. IMHO it should reload the last open image upon restart.
Also, I think it would be better to rename menu item Tool to Tools, most applications use it in plural.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 23, 2014, 08:41:31 am
Thanks I will have a look at it.
If you have not started doing something on the patch, please let me know, I will upload a complete patch, including the fixed bug (asking to save changed documents).
I have fixed some other bugs, too.
I wonder if I should make Autouncheck work for edited files only  :-\ Maybe I should put another checkbox for that?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 23, 2014, 08:04:59 pm
Ok send the new patch. Note that if I update on SVN anyway, you can make a patch compared to the current version.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 24, 2014, 11:49:13 am
I have attached the patch.
If s.o. wants to try the win32 exe (http://dox.bg/files/dw?a=65fa054808) (valid 2 weeks). Image list is to be found in Main menu->View->Image list

For some reason, items in the Selection and Tools menu have duplicated shortcuts, which do not work?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 24, 2014, 06:04:18 pm
That looks interesting. It is useful if you want to go through a list of picture to modify them or display them.

I am not sure about the check thing. Would seem more natural to me that checked lines are lines that are already done.

It is a bit confusing that the icon to minimize the window is similar to the mirror effect.

It is a very good idea to be able to minimize the window.

About the duplicated shortcuts, it is normal. You need to press twice the shortcut key in order to get the second item that has the shortcut.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 25, 2014, 07:45:15 am
It is useful if you want to go through a list of picture to modify them or display them.
 


It might be used for batch processing, if implemented, one day.
 

I am not sure about the check thing. Would seem more natural to me that checked lines are lines that are already done.

 

I uploaded the exe, considering that there might be some user user feedback.  Maybe I can add a pop-up menu, to select uncheck mode, or replace it with a combobox. The checkmark button does not look good, anyway.

It is a bit confusing that the icon to minimize the window is similar to the mirror effect.
 


I have attached two icons. Maybe roll_up.png should make window smaller, and roll_down.png-bigger (there are some similar behaviour in some *nix desktop environments). Would you change them, or I'd better submit a new patch?
About icons, visual appearance, etc, I suppose it is you who has to have the final decision, in order to prevent inconsistency.


When you update repository, I will add some extra functionality.

 

About the duplicated shortcuts, it is normal. You need to press twice the shortcut key in order to get the second item that has the shortcut.
I see now. I see place for a shortcut editor.  ;D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 25, 2014, 02:00:39 pm
It might be used for batch processing, if implemented, one day.
Yes with the scripting feature. Basic working of scripting is 80% done I would say.

Quote
I uploaded the exe, considering that there might be some user user feedback.  Maybe I can add a pop-up menu, to select uncheck mode, or replace it with a combobox. The checkmark button does not look good, anyway.
Finding the right interface look is not easy sometimes. I understand however the idea that if it is to be processed then you would check it for that.

Quote
I have attached two icons. Maybe roll_up.png should make window smaller, and roll_down.png-bigger (there are some similar behaviour in some *nix desktop environments). Would you change them, or I'd better submit a new patch?
About icons, visual appearance, etc, I suppose it is you who has to have the final decision, in order to prevent inconsistency.
I think these icons are a bit too os-specific. What about those ones? Yes I may change one or more icon however of course suggestions are welcome.

Quote
When you update repository, I will add some extra functionality.
Done. Now you can.  :)

Quote
I see now. I see place for a shortcut editor.  ;D
Well, why not.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 25, 2014, 05:38:10 pm
I think these icons are a bit too os-specific. What about those ones?
Perfect  :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 25, 2014, 06:41:06 pm
Thanks.

Fahmy Rofiq is going to be happy, I have optimised the rotate layer function. While rotating, box filter is used (integer coordinates). And affine transformation using box filter is now very optimised.

This is on SVN (LazPaint and BGRABitmap). It requires last update of BGRABitmap.

 :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 25, 2014, 08:11:25 pm
This bug still stays:

There is a problem- when the window is closed with a click on the + button, it needs to be enabled twice in order to be shown again.
I hope circular won't have troubles fixing it.


 
...I have optimised the rotate layer function. While rotating, box filter is used (integer coordinates).
I see no box anywhere. I expected rotation to be done differently. IMHO, there should be a dialog box, allowing to enter exact rotation value and offset  (example from Gimp is attached) . Now I simply cannot adjust the angle even close to what I need, I wonder how other people can.
I could check if I can do something about that, after I am done with the image list and resizing percentage of the layers, if no one does not take care for that in shorter time?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 26, 2014, 07:33:17 pm
This bug still stays:

There is a problem- when the window is closed with a click on the + button, it needs to be enabled twice in order to be shown again.
I hope circular won't have troubles fixing it.
Ah ok. Fixed.

Quote
...I have optimised the rotate layer function. While rotating, box filter is used (integer coordinates).
I see no box anywhere. I expected rotation to be done differently. IMHO, there should be a dialog box, allowing to enter exact rotation value and offset  (example from Gimp is attached) . Now I simply cannot adjust the angle even close to what I need, I wonder how other people can.
I could check if I can do something about that, after I am done with the image list and resizing percentage of the layers, if no one does not take care for that in shorter time?
No no, box filter is not about showing a box, but about how intermediate pixels are determined. Basically a box filter does not involve mixing pixels colors, so it is less beautiful. Gimp preview for rotation for example is rather ugly.

I don't how other people can or if they can do what you want. You need is to have a precise angle if I understand. This could be added in the toolbar. However, remember this version is to be published, so let's not get into too much complicated things. We can add many things in a future version.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 27, 2014, 08:14:48 am
Gimp preview for rotation for example is rather ugly.
 
Gimp itself is ugly.
 


I don't how other people can or if they can do what you want. You need is to have a precise angle if I understand. This could be added in the toolbar.

I would rather disagree with adding this functuality in the toolbar. I quite often scan documents and sometime I need to rotate 1 or 2 degrees, sometimes even 1,3 degrees, for example. The benefit of the resizable window is that I can enlarge it and put it under a line or a column, to make sure it is at the correct angle (see attached sample- I am verifying with the top and right rim of the form). Maybe a semi- transparent window will be better.
 

However, remember this version is to be published, so let's not get into too much complicated things. We can add many things in a future version.

Well, I do not mean now  ;D


So, I think I have done all functionality of the image list I have thought of. Before submitting the patch, I have to mention that I found a bug in the ImageList implementation, which occurred to be related on a bug in the Layers Window- and exactly: Layers Window width and height are not retrieved from the .cfg file upon restart of the app (they are stored, anyway). Would you like to fix the Layers Window, so I could fix image list with the same code, or it shall be left for a later stage?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 27, 2014, 09:24:13 am
Gimp preview for rotation for example is rather ugly.
 
Gimp itself is ugly.
Ok. However I am talking about the rendering of the pixels. They seem to be scrambled.

Quote
I would rather disagree with adding this functuality in the toolbar. I quite often scan documents and sometime I need to rotate 1 or 2 degrees, sometimes even 1,3 degrees, for example. The benefit of the resizable window is that I can enlarge it and put it under a line or a column, to make sure it is at the correct angle (see attached sample- I am verifying with the top and right rim of the form). Maybe a semi- transparent window will be better.
I don't quite understand, tell me if I did not get what you mean. In the toolbar, we can add a TextBox where the user can enter an angle in degrees as a floating point value, or a NumericUpDown with 2 decimal places. About the rim, are you talking about the fact that the image is drawn outside of the bounds so that you can see how much of the image will be clipped?

Quote

However, remember this version is to be published, so let's not get into too much complicated things. We can add many things in a future version.
Well, I do not mean now  ;D
Alright.

Quote
So, I think I have done all functionality of the image list I have thought of. Before submitting the patch, I have to mention that I found a bug in the ImageList implementation, which occurred to be related on a bug in the Layers Window- and exactly: Layers Window width and height are not retrieved from the .cfg file upon restart of the app (they are stored, anyway). Would you like to fix the Layers Window, so I could fix image list with the same code, or it shall be left for a later stage?
Ok, fixed.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Fahmy Rofiq on June 28, 2014, 05:25:53 pm
Thanks.

Fahmy Rofiq is going to be happy, I have optimised the rotate layer function. While rotating, box filter is used (integer coordinates). And affine transformation using box filter is now very optimised.

This is on SVN (LazPaint and BGRABitmap). It requires last update of BGRABitmap.

 :)
Thank you so much circular, layer rotation is really faster now. :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on June 30, 2014, 10:09:55 am
A patch for the imagelist is attached. So far I don't have ideas for other useful features of the image list.
Please check LazPaintMainform, line 1531. There was a bug, I quite of fixed it, but there is something small which is not okay.
Also I fixed the ubrowse filename manual enter issue. Should I add a checkbox or something, in case someone wants to disable editing the text field?
I have added panels in the about dialog, because some of the strings were overlapping with some loacalizations. Same technique could provide fail-save localization in some other  forms, i.e. the resize one.
Also, I have replaced some messagedlgs with questiondlgs, because  messagedlgs do not allow translating of button captions. I did not replace all  messagedlgs  in the project, because you might consider questiondlgs uglier.



Gimp itself is ugly.
Ok. However I am talking about the rendering of the pixels. They seem to be scrambled.
 

Maybe they are downsampling the image, in order to fasten preview.


I don't quite understand, tell me if I did not get what you mean. In the toolbar, we can add a TextBox where the user can enter an angle in degrees as a floating point value, or a NumericUpDown with 2 decimal places. About the rim, are you talking about the fact that the image is drawn outside of the bounds so that you can see how much of the image will be clipped?
 
No, I mean something else. I will add screenshots for a better explnanation later... when I happen to have time.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 01, 2014, 09:36:30 pm
I will try that. Thanks for the help.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 06, 2014, 11:12:36 pm
I have uploaded the patch with some fixes.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 08, 2014, 02:35:49 pm
And with the fixes came some bugs : :-X

1. If some of the files added to the main window of LazPaing by drag and drop is not supported an error message is shown that the file is not supported and no files are added. AFAIR I have tested this before sending the patch- an error message used to be shown, but all other files were added.
I see no reason why this message should be shown in this particular situation, I just kept your previous behaviour.
In uimagelist.pas there is a function IsExtensionValid. You might consider to move it to a PAS file with global functions and use it in the main form, too.

2. You have changed shortcuts for Next and Previous image from the image list to Alt+Left and Alt+Right.
2.1. Now when I press one of the shortcuts an image is skipped, i.e. if file 3 is open, the next open file is 5, instead of 4.
I think the reason is that pressing the arrow key moves the selected row a line up/down, and after that the procedure is called and the line is moved once again.
The problems is that I cannot disable keyboard navigation (auto advance:=false does not help).
One possible solution is to store the current row and increment it upon alt-Left/right.
Could there be another way out?
Edit: I fixed it by disabling stringgrid on Alt, and reenabling it on KeyUp. I will submit a patch, unless you prefer another solution.

2.2. I have assigned Space and BackSpace because they are active only when the imagelist is active. Maybe with  Alt+Left and Alt+Right these shortcuts should become global?

3.  When files are added to the image list the first one is opened automatically. I am not sure that this is a good idea, maybe some settings checkbox should be used? I would ask other users (if any) opinions.

4. I wonder- maybe the imagelist shall show automatically, after files are dragged and dropped in the image list? What do you think?
5. On Line 307 WidthMinimal:=300 shall become WidthMinimal:=340, because of the increased number of buttons.

6. I saw some Paskal added in the About info. If you insist that my name should be added there, I'd rather prefer to be quoted under Contributors, or if that is not okay- as СМ630.

7. What about leaving the imagelist.pas under LGPL3 licence? I think there is no problem if separtae components have separate licensing?


8. Just a reminder to myself, so I don;'t forget for thenext release of LazPaint- to add files to the image list trough commande line...if it makes sense.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on July 08, 2014, 03:15:16 pm

7. What about leaving the imagelist.pas under LGPL3 licence? I think there is no problem if separtae components have separate licensing?

I would vote against *gpl* license and the imagelist is one of the most used one the moment the modified lgpl is forfited isthe moment I will drop lazarus from my tool chain. I have no problem that lazarus is gpled in fact I would probably advice gpl for lazarus my self but lcl and the components require a more liberal license if not a bsd based one then the mpl is closer to what I would use.

If the gpl crowd wants to see enemies everywhere then let them play in their own corner and let us move to a more free world.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 09, 2014, 01:21:59 am
Are you talking about uimagelist.pas?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on July 09, 2014, 05:24:16 am
I'm talking about gpl and how it is unacceptable for libraries and components, the minimum requirements for any library is the modified lgpl that lazarus is using and only if the library is big enough that rewriting it would be out of the question if it is small eg bgrabitmap then a rewrite or an alternative will be used to avoid any potential problems.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 09, 2014, 11:58:51 pm
Ah I understand. Well LGPL is convenient for components.

However we are talking about LazPaint software, not BGRABitmap library.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on July 10, 2014, 05:56:42 am
lgpl is not ok for components that static linking is forcing me in to gpl and I was talking about the imagelist so not so much about lazpaint. In any case it is your components and your program so after voicing my license objections I'll let you move on with your development and thank you for your time.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 10, 2014, 09:42:49 am
I mean uimagelist.pas only, since LazPaint is GPL.

It's a general practice, that all PAS files have a copyright notice in their headers, something like this:

{
    Name of product- product description.
    Copyright (C) 20xx-2014  Name of Authors

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
}

Since uimagelist.pas (with some changes) can be used for similar purposes in other apps, I would prefer it to be released under LGPL.
Because LGPL is less restrictive than GPL, I think there is no problem for a GPL app tu use LGPL components?
I got the impression, that *taaz is not talking about  uimagelist.pas, but generally, do I understand things right?
Edit... I just read some more about LGPL. It seems more restrictive than GPL, I have no idea  why I've got the opposite impression.

I am still waiting for Circulars opinion on items 2 and 4, so I will know if I should take some activities.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: BigChimp on July 10, 2014, 11:14:58 am
It's a general practice, that all PAS files have a copyright notice in their headers, something like this:
That's a license statement + a copyright notice ;) But yes, it can help if you are dealing with various licenses in one project...

Edit... I just read some more about LGPL. It seems more restrictive than GPL, I have no idea  why I've got the opposite impression.
No idea where you read that. You're not allowed to link GPL units into (basically) non-GPL licensed programs, but you are allowed to do that with LGPL. As taazz indicated, GPL is not enough for libraries for many people (me included) for that reason.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 10, 2014, 12:09:47 pm
Eeer, any idea what license should be used for "do what you want with the code, just mention the source in the about info, so other people can find and use it easily?"
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on July 10, 2014, 12:21:53 pm
Eeer, any idea what license should be used for "do what you want with the code, just mention the source in the about info, so other people can find and use it easily?"
depends on what kind of "do what you want with the code" you are after. For example the mpl requires that any enhancements on the library it self is suppose to be made public as well anything else can be under any license as long as the source is mentioned on the about box. if you want to allow a more "free" usage eg even enhancements can be on any license then a derivative of BSD should do the job. Personally for components and libraries I prefer the MPL, although the ip stack that every modern system has build in began its life on BSD license.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 10, 2014, 05:15:01 pm
I got the impression, that *taaz is not talking about  uimagelist.pas, but generally, do I understand things right?
Yes I guess tazz is talking about imagelist component of Lazarus.

Quote
Since uimagelist.pas (with some changes) can be used for similar purposes in other apps, I would prefer it to be released under LGPL. Because LGPL is less restrictive than GPL, I think there is no problem for a GPL app tu use LGPL components?
I understand, however it is too dependent here to be separate component. In order to make it a component, I guess the simplest thing would be to do a package (we can put it on LazPaint repository or another one). Then you'll see when compiling it if it is independent. You will need to add some way to define the labels instead of using the constants from uresourcestring.pas and to set the list of file types.

Quote
Edit... I just read some more about LGPL. It seems more restrictive than GPL, I have no idea  why I've got the opposite impression.
It is less restrictive for me, because it allows to be embedded into another program with another license.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 11, 2014, 07:32:03 am
 quote author=taazz link=topic=12037.msg152148#msg152148 date=1404987713]
Eeer, any idea what license should be used for "do what you want with the code, just mention the source in the about info, so other people can find and use it easily?"
depends on what kind of "do what you want with the code" you are after. For example the mpl requires that any enhancements on the library it self is suppose to be made public as well anything else can be under any license as long as the source is mentioned on the about box. if you want to allow a more "free" usage eg even enhancements can be on any license then a derivative of BSD should do the job. Personally for components and libraries I prefer the MPL, although the ip stack that every modern system has build in began its life on BSD license.

MPL seems too restrictive for this case. BSD licenses seem fine.

Quote
Since uimagelist.pas (with some changes) can be used for similar purposes in other apps, I would prefer it to be released under LGPL. Because LGPL is less restrictive than GPL, I think there is no problem for a GPL app tu use LGPL components?
I understand, however it is too dependent here to be separate component. In order to make it a component, I guess the simplest thing would be to do a package (we can put it on LazPaint repository or another one). Then you'll see when compiling it if it is independent. You will need to add some way to define the labels instead of using the constants from uresourcestring.pas and to set the list of file types.
There is a point in that.
But I there is an issue: someone posts a function, for example in this forum. Then I use it in my source. If I publish my source (for example) under GPL, it will contain functions, which I do not own and therefore I cannot apply restrictions on them. So what to to then? Shall these functions have standalone licensing, or shall they be put in a separate unit, with separate licensing?
Maybe that shall be discussed in another thread in another section of the forum?

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 11, 2014, 01:27:35 pm
Here are my answers, Paskal. Please tell me if you intend to take care of one of those so that we do not do it twice.

And with the fixes came some bugs : :-X

1. If some of the files added to the main window of LazPaing by drag and drop is not supported an error message is shown that the file is not supported and no files are added. AFAIR I have tested this before sending the patch- an error message used to be shown, but all other files were added.
I see no reason why this message should be shown in this particular situation, I just kept your previous behaviour.
The reason is that if there are 50 files that cannot be opened, this will show 50 message boxes. Otherwise we can agglomerate error messages for the different files and display them in one single message box, and load the image with the files that could be read.

Quote
In uimagelist.pas there is a function IsExtensionValid. You might consider to move it to a PAS file with global functions and use it in the main form, too.
Yes, in any case, it would be a good thing to put this in a separate unit as simple procedures/functions. Then, this unit could be moved to any package.

Quote
2. You have changed shortcuts for Next and Previous image from the image list to Alt+Left and Alt+Right.
2.1. Now when I press one of the shortcuts an image is skipped, i.e. if file 3 is open, the next open file is 5, instead of 4.
I think the reason is that pressing the arrow key moves the selected row a line up/down, and after that the procedure is called and the line is moved once again.
The problems is that I cannot disable keyboard navigation (auto advance:=false does not help).
One possible solution is to store the current row and increment it upon alt-Left/right.
Could there be another way out?
Edit: I fixed it by disabling stringgrid on Alt, and reenabling it on KeyUp. I will submit a patch, unless you prefer another solution.
That is a way to solve it. That said, Key variable should be set to zero to say it has been processed. This could solve the problem too.

Quote
2.2. I have assigned Space and BackSpace because they are active only when the imagelist is active. Maybe with  Alt+Left and Alt+Right these shortcuts should become global?
That is why I changed the shortcuts, to make them global shortcuts. Space and Backspace obviously interferes with tools input.

Quote
3.  When files are added to the image list the first one is opened automatically. I am not sure that this is a good idea, maybe some settings checkbox should be used? I would ask other users (if any) opinions.
Yeah I don't know. I thought that it would be quicker. Also the problem is that when we click the Next arrow, it opens the second file when in my opinion if the first one has not been opened, it should be opened at this moment.

Quote
4. I wonder- maybe the imagelist shall show automatically, after files are dragged and dropped in the image list? What do you think?
I suppose you mean when files are dropped in LazPaint, and that we choose to open in image list? Yes that is a good idea.

Quote
5. On Line 307 WidthMinimal:=300 shall become WidthMinimal:=340, because of the increased number of buttons.
Ok.

Quote
6. I saw some Paskal added in the About info. If you insist that my name should be added there, I'd rather prefer to be quoted under Contributors, or if that is not okay- as СМ630.
So to add a line under Author? If you like, yes.

Quote
8. Just a reminder to myself, so I don;'t forget for thenext release of LazPaint- to add files to the image list trough commande line...if it makes sense.
That can prove useful if you call LazPaint from a batch file or a third party program.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 11, 2014, 01:45:48 pm
someone posts a function, for example in this forum. Then I use it in my source. If I publish my source (for example) under GPL, it will contain functions, which I do not own and therefore I cannot apply restrictions on them. So what to to then? Shall these functions have standalone licensing, or shall they be put in a separate unit, with separate licensing?
Maybe that shall be discussed in another thread in another section of the forum?
If someone posts a function, I suppose he/she does not mind it being GPL/LGPL/MPL/BSD. If you want to be clear in your code, you can write before the function something like "This function comes from a public forum and can be reused without any restriction".
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: BigChimp on July 11, 2014, 01:56:27 pm
But I there is an issue: someone posts a function, for example in this forum. Then I use it in my source. If I publish my source (for example) under GPL, it will contain functions, which I do not own and therefore I cannot apply restrictions on them. So what to to then? Shall these functions have standalone licensing, or shall they be put in a separate unit, with separate licensing?
Maybe that shall be discussed in another thread in another section of the forum?
I think it is a very good idea to split off that discussion to a new discussion thread in an a more relevant section. I'm sure though that you'll get very many responses...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 11, 2014, 03:26:30 pm
 
Here are my answers, Paskal. Please tell me if you intend to take care of one of those so that we do not do it twice.

And with the fixes came some bugs : :-X

1. If some of the files added to the main window of LazPaing by drag and drop is not supported an error message is shown that the file is not supported and no files are added. AFAIR I have tested this before sending the patch- an error message used to be shown, but all other files were added.
...
The reason is that if there are 50 files that cannot be opened, this will show 50 message boxes. Otherwise we can agglomerate error messages for the different files and display them in one single message box, and load the image with the files that could be read.
 

I like the idea of agglomerating error messages. What about a for with a Memo inside and an Okay button? Next week I will check if I can talk with the file opening function.
Quote
In uimagelist.pas there is a function IsExtensionValid. You might consider to move it to a PAS file with global functions and use it in the main form, too.

Yes, in any case, it would be a good thing to put this in a separate unit as simple procedures/functions. Then, this unit could be moved to any package.
 

Okay, please tell a name for the unit.
Quote
2. You have changed shortcuts for Next and Previous image from the image list to Alt+Left and Alt+Right.
2.1. Now when I press one of the shortcuts an image is skipped, i.e. if file 3 is open, the next open file is 5, instead of 4.
I think the reason is that pressing the arrow key moves the selected row a line up/down, and after that the procedure is called and the line is moved once again.
The problems is that I cannot disable keyboard navigation (auto advance:=false does not help).
One possible solution is to store the current row and increment it upon alt-Left/right.
Could there be another way out?
Edit: I fixed it by disabling stringgrid on Alt, and reenabling it on KeyUp. I will submit a patch, unless you prefer another solution.
That is a way to solve it. That said, Key variable should be set to zero to say it has been processed. This could solve the problem too.

Quote
2.2. I have assigned Space and BackSpace because they are active only when the imagelist is active. Maybe with  Alt+Left and Alt+Right these shortcuts should become global?
That is why I changed the shortcuts, to make them global shortcuts. Space and Backspace obviously interferes with tools input.
Still they are not global. So if you have no other solution for item 2,1 I will submit a patch for mine. I will check if I can make shortcuts global.

Quote
3.  When files are added to the image list the first one is opened automatically. I am not sure that this is a good idea, maybe some settings checkbox should be used? I would ask other users (if any) opinions.
Yeah I don't know. I thought that it would be quicker. Also the problem is that when we click the Next arrow, it opens the second file when in my opinion if the first one has not been opened, it should be opened at this moment.
 

The last one is a point, indeed. So I will leave autoopening, only if there are no other files in the filelist. If there are files, already, a new file will not be open. Does it sound okay?
Quote
4. I wonder- maybe the imagelist shall show automatically, after files are dragged and dropped in the image list? What do you think?
I suppose you mean when files are dropped in LazPaint, and that we choose to open in image list? Yes that is a good idea.
 

I will do it.
Quote
5. On Line 307 WidthMinimal:=300 shall become WidthMinimal:=340, because of the increased number of buttons.
Ok.
 
I'll fix that.
Quote
6. I saw some Paskal added in the About info. If you insist that my name should be added there, I'd rather prefer to be quoted under Contributors, or if that is not okay- as СМ630.
So to add a line under Author? If you like, yes.
 
I mean that I do not like the idea to be listed as "Paskal". I am okay being named as Contributors  ;D .
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 11, 2014, 03:43:53 pm
If someone posts a function, I suppose he/she does not mind it being GPL/LGPL/MPL/BSD. If you want to be clear in your code, you can write before the function something like "This function comes from a public forum and can be reused without any restriction".
When I post my code I would not like someone to take rights over it and to prevent others, including myself to use it. I had a project in Berlios, I think it is in SF now, and I do include information for subs, which are not made by myself.
Anyway, I will start a thread in the Global section.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on July 11, 2014, 04:03:54 pm
When I post my code I would not like someone to take rights over it and to prevent others, including myself to use it.

That can not happen unless you create that function when hired in a full time job. As far as I know there is no way you can forfeit your owner ship, you only pass the right to use and share any one getting that code even when you put it on public domain license can use only under the terms you specify he can't hijack your rights.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 11, 2014, 06:15:20 pm
When I post my code I would not like someone to take rights over it and to prevent others, including myself to use it.
I agree with that. Yes well let's continue on another thread because we are getting into misunderstandings and this might take a lot of pages. My point of view basically is that LGPL code can move freely between LGPL projects, however I reckon not everybody would agree with that. I would have a problem however with code moving from LPGL to commercial.

Quote
I had a project in Berlios, I think it is in SF now, and I do include information for subs, which are not made by myself.
Yes it avoids any ambiguity.

EDIT: Please put the link to the thread you create for that subject. I guess your main question is about reusing portion of code from someone else or from another project.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 11, 2014, 07:27:55 pm
I like the idea of agglomerating error messages. What about a for with a Memo inside and an Okay button? Next week I will check if I can talk with the file opening function.
Ok.

Quote
Okay, please tell a name for the unit.
ufileext.pas?

Quote
Still they are not global. So if you have no other solution for item 2,1 I will submit a patch for mine. I will check if I can make shortcuts global.
Yes, they are global. Well I fixed the double handling of the key already.

Quote
The last one is a point, indeed. So I will leave autoopening, only if there are no other files in the filelist. If there are files, already, a new file will not be open. Does it sound okay?
Yes, well I think that it does already.

Quote
Quote
I suppose you mean when files are dropped in LazPaint, and that we choose to open in image list? Yes that is a good idea.
I will do it.
Ok.

Quote
I mean that I do not like the idea to be listed as "Paskal". I am okay being named as Contributors  ;D .
I get it. Maybe something like "Circular helped by Lainz, FabienWang and others"?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 15, 2014, 04:46:04 pm
This version is almost ready to be released. So if there are any last comments, please tell me.

Paskal, please tell me if you have the time for the last changes.

Cheers.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 18, 2014, 07:07:27 am
Please publish the version, I will apply changes for the next one.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 21, 2014, 12:02:13 am
Alright. Well I need some more translations. I can do some of it, but I am not fluent in all those languages!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 21, 2014, 10:57:10 am
I have started translating LazPaint, but I think I won't be ready for that version. I will try to finish the main menu, at least.
Talking about hat, I cannot translate "selection fit", because I cannot understand what it does?
Hint?


And I just not to forget- I have to add a label "Number of files: xx; Todo files: yyy" in the imagelist.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 21, 2014, 01:03:55 pm
I answered in the translation thread:
http://forum.lazarus.freepascal.org/index.php/topic,13975.msg152978.html#msg152978
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 23, 2014, 04:11:52 pm
I have updated the zip files of the incoming version:

The test version is number 5.9c. It is not a release. Here are the download links of the source code:
http://sourceforge.net/projects/lazpaint/files/src/lazpaint5.9c_src.zip/download
http://sourceforge.net/projects/lazpaint/files/src/bgrabitmap7.6.zip/download
http://sourceforge.net/projects/bgra-controls/files/bgra-controls-3.0/bgra-controls-3.2-20140421.7z/download
http://sourceforge.net/projects/lazpaint/files/src/inet0.6.6.zip/download

Unless there are any objections, or any last language update, this will be the next released version as 6.0.

Cheers
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 25, 2014, 07:39:43 am
I noticed something odd in the trunk version.
For some reason some of the translations files (POs) get copied into the C:\Documents and Settings\<username>\ folder, in the same place where the INI file is stored. And LazPaint sees only them, it cannot switch to the other languages, whose POs are in the application folder.
I have never seen an application storing translation files in the  C:\Documents and Settings\<username>\ folder and I still see no reason for such behaviour. Shall it be the same with the official version, or this is done for some development purposes?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 25, 2014, 03:25:36 pm
Those languages files are updated languages files. When the application is published, some translations are not done yet. So I added a mechanism to download those automatically. There are no language files to download with the 6.0 yet of course. Those files are from the previous versions. They were indeed used instead of the new languages files in the application folder. I already fixed that on SVN and in the source zip files I just published.

The downloaded languages cannot be in the application folder in new version of Windows and on MacOS. It cannot be stored either in a temporary folder, because then it would be deleted without notice. So it is appropriate to store it in a configuration folder.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 28, 2014, 08:00:17 am
The downloaded languages cannot be in the application folder in new version of Windows and on MacOS. It cannot be stored either in a temporary folder, because then it would be deleted without notice. So it is appropriate to store it in a configuration folder.
I am not sure what you mean by The downloaded languages cannot be in the application folder in new version of Windows. Do you mean that due to some user restrictions if they are downloaded later thay cannot be installed in the same folder?
For example- administrator installs LazPaint and the less rights user cannot download the translation files in the application folder?
Or you mean something else?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 28, 2014, 11:16:58 am
I am not an expert on that subject, but there are restrictions, and in newer version of Windows a system of redirection of file access that are supposed to be in the Program Files folder. And in MacOS, files are in an archive where binaries are in a different folder than data, and I don't know what accesses are granted there.

On the contrary, configuration folder seem to work great on any platform. If it works, why change it?

For portable application, it is possible to redefine the configuration folder and so where those extra languages will be stored.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 28, 2014, 01:54:54 pm
Errr, I think Utorrent makes some trick... it sort of installs itself somewhere after first run. I will have to check these days.
I could offer you the following solution:
1. Either distribute all languages in a single package, considering that they wont' take so much space.
2. Another solution I've seen- one installer with all languages and one with English only.
Anyway, in my opinion a zipped (7zip, whatever) package shall always be available for download. I is a pain to installsomething, then copy it somewhere and the uninstall it.
As a matter of fact, recently I tried to run my app in Windows 7 and it gave some error due to access rights, but this happened even when running it from the My Documents folder. Reading you explanation about MacOs, I think that the idea of two distros (one full and one English only) should be less problematic, unless you have a Mac to try.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 29, 2014, 12:39:47 am
No no, it works fine like that. There may be a misunderstanding.

Languages are copied during the installation process. But updates for language files that were not finished when the install was built are downloaded automatically in order to fill the gaps afterwards.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on July 30, 2014, 03:32:10 pm
Quote
Still they are not global. So if you have no other solution for item 2,1 I will submit a patch for mine. I will check if I can make shortcuts global.
Yes, they are global. Well I fixed the double handling of the key already.
So, it occurs that these keys work, if the image list panel or the main form is active.
They do not work, if another panel (i.e. Tools) is active. I have no idea if this might be hard to fix.


Also, there is a bug in the image list: when new files are added, if AutoFit (fit zoom) is enabled, the first image, that is automatically open does not get fit.
To fix it, just copy the last line of the OpenImage function after the tbImageClick(nil); line in the AddFiles function. I could send a patch, but I suppose this way would be easier for you.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 31, 2014, 06:15:14 pm
So, it occurs that these keys work, if the image list panel or the main form is active.
They do not work, if another panel (i.e. Tools) is active. I have no idea if this might be hard to fix.
Oh I get it. Well when the mouse is moved over the main window, this one becomes active, so it is not a big problem.

Quote
Also, there is a bug in the image list: when new files are added, if AutoFit (fit zoom) is enabled, the first image, that is automatically open does not get fit.
To fix it, just copy the last line of the OpenImage function after the tbImageClick(nil); line in the AddFiles function. I could send a patch, but I suppose this way would be easier for you.
I don't seem to have this problem. If there are no files in the list then it works, and if there are already files in the list, then the first added image is not opened.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 31, 2014, 06:39:12 pm
Hello people,

It seems version 6.0 is ready. Now I need some help to make binaries of the program.

Here are all the zip files:
http://sourceforge.net/projects/lazpaint/files/src/lazpaint6.0_src.zip/download
http://sourceforge.net/projects/lazpaint/files/src/bgrabitmap7.6.zip/download
http://sourceforge.net/projects/bgra-controls/files/bgra-controls-3.0/bgra-controls-3.2-20140421.7z/download
http://sourceforge.net/projects/lazpaint/files/src/inet0.6.6.zip/download

I can do win32 binaries and linux32 binaries, but I cannot do:
- win64 binaries: done by Leledumbo
- linux64 binaries: done by Leledumbo
- MacOS binaries

About MacOS binaries, you can take a look at a previous archive to see the structure it is supposed to have. There are some special requirements for the directories.

Cheers
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Leledumbo on July 31, 2014, 10:46:42 pm
win64 (native win32) & linux64 binaries (gtk2 + qt) uploaded
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 01, 2014, 01:26:30 am
Thank you very much Leledumbo.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on August 04, 2014, 09:41:34 am
Quote
Also, there is a bug in the image list: when new files are added, if AutoFit (fit zoom) is enabled, the first image, that is automatically open does not get fit.
To fix it, just copy the last line of the OpenImage function after the tbImageClick(nil); line in the AddFiles function. I could send a patch, but I suppose this way would be easier for you.
I don't seem to have this problem. If there are no files in the list then it works, and if there are already files in the list, then the first added image is not opened.
I do not mean opening/not opening of the image, but autozooming it. Anyway, I will submit a patch for that, together with some other stuff.I'd like to discuss some other issues:

1. I came across the following issue: when I select an area , then invert selection,  it is possible to do Crop to selection. What actually happens is that the initially selected area is deleted. I do wonder if in such cases Crop to selection should not be disabled?

I tried Gimp (an old version) , in the same case Cropping does not get disabled, and yet it does nothing when selected. Maybe someone can tell how Photoshop behaves?

2. When Save As is selected from the menu, the default filter shown is All file types (*.*).

Actually if no extension is written, the file is save as BMP.
IMHO, default extension should be the one of the edited file itself. Anyway if it stays BMP, then it would be much better if instead of  All file types (*.*), to show Bitmap (*.bmp). What to you think?
I can take care for that issue.

3. I'd like to ask @Circular, if he has plans when the next version of LazPiant shall be released?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 04, 2014, 03:16:07 pm
I do not mean opening/not opening of the image, but autozooming it. Anyway, I will submit a patch for that, together with some other stuff.
Maybe I will understand better what you want to say with the patch.

Quote
1. I came across the following issue: when I select an area , then invert selection,  it is possible to do Crop to selection. What actually happens is that the initially selected area is deleted. I do wonder if in such cases Crop to selection should not be disabled?

I tried Gimp (an old version) , in the same case Cropping does not get disabled, and yet it does nothing when selected. Maybe someone can tell how Photoshop behaves?
Personally I think it is a good thing that the non selected area is deleted in this case.

Quote
2. When Save As is selected from the menu, the default filter shown is All file types (*.*).

Actually if no extension is written, the file is save as BMP.
Nope it is PNG.

Quote
IMHO, default extension should be the one of the edited file itself. Anyway if it stays BMP, then it would be much better if instead of  All file types (*.*), to show Bitmap (*.bmp). What to you think?
I can take care for that issue.
Currently the default extension is PNG. In the dialog box, I think it is ok that the format is not defined. I think that then when we save, the default format should be PNG if there is no layer and LZP if there are layers.

If there is any the current extension of the file, it is a good idea to set this as the extension in the dialog box, unless it is already set to something. For example, we can open a series of file in BMP format and save them in TIFF, and I would not want to change to TIFF extension each time I do "save as".

Quote
3. I'd like to ask @Circular, if he has plans when the next version of LazPaint shall be released?
I am waiting to have more feedback to know if there are quick fixes to apply in priority. Until now, there does not seem to by any serious issue, so I guess we can soon start to progress towards a new version. A new version may be released in December for example. There is no hurry as the published version seems satisfactory. It depends also if we have much ideas and time to do it.

I have already noted the following things to do in the next version:
- reduce zoom if the image is too big when opening with File > Open
- add more filters
- save image browser size in configuration
- take into account DPI resolution of images
- display somewhere information about the image (size, number of colors)
- correct a bug when typing the size of the brush
- make it easier to change brush size and text size
- propose quick colours that have been used recently
- fix a bug with 3d rendering (normal vector becoming zero)
- handle custom normals for vertices

Cheers
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on August 04, 2014, 03:52:14 pm
Quote
1. I came across the following issue: when I select an area , then invert selection,  it is possible to do Crop to selection. What actually happens is that the initially selected area is deleted. I do wonder if in such cases Crop to selection should not be disabled?

I tried Gimp (an old version) , in the same case Cropping does not get disabled, and yet it does nothing when selected. Maybe someone can tell how Photoshop behaves?
Personally I think it is a good thing that the non selected area is deleted in this case.
 


Well, it sort of duplicates Delete function, yet it might be useful. Maybe a different name shall be given to this activity?


 

Quote
2. When Save As is selected from the menu, the default filter shown is All file types (*.*).

Actually if no extension is written, the file is save as BMP.
Nope it is PNG.
Quote
IMHO, default extension should be the one of the edited file itself. Anyway if it stays BMP, then it would be much better if instead of  All file types (*.*), to show Bitmap (*.bmp). What to you think?

I can take care for that issue.
Currently the default extension is PNG. In the dialog box, I think it is ok that the format is not defined.
So how are users supposed to know that default extension is PNG? There is an option to use filtering like PNG|*.*|JPG|*.*...
This way all files shall be seen, but users would know what extension is supposed to be added.
 

I think that then when we save, the default format should be PNG if there is no layer and LZP if there are layers.

 

Indeed, other formats do not support transparency. But, I can tell for myself that most of the time I do not need transparency and it is quite problematic, because I have to keep filling it with colour. So I would not like to save a JPG as a PNG and vice versa.
I read somewhere that you prefer an application without a settings dialogues, but maybe LazPaint became too big to do without it.
 

If there is any the current extension of the file, it is a good idea to set this as the extension in the dialog box, unless it is already set to something. For example, we can open a series of file in BMP format and save them in TIFF, and I would not want to change to TIFF extension each time I do "save as".
 


I see the point. So there might be a checkbox to set extension permanently (for the session) to the new value. But that means that a custom SaveDialog shallbe used, which sounds like a lot of time.
Generally in this case I proceed with batch processing- convert everything in the output format and then edit it.
 

Quote
3. I'd like to ask @Circular, if he has plans when the next version of LazPaint shall be released?

I am waiting to have more feedback to know if there are quick fixes to apply in priority.I have already noted the following things to do in the next version:

...
I would like to ask if working in a transparencyless mode could take less resources (mempory, CPU, etc). And how hard it would be to do implement it?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 04, 2014, 04:52:33 pm
Well, it sort of duplicates Delete function, yet it might be useful. Maybe a different name shall be given to this activity?
Well no because if the border is not selected, the image is reduced.

Quote
So how are users supposed to know that default extension is PNG? There is an option to use filtering like PNG|*.*|JPG|*.*...
This way all files shall be seen, but users would know what extension is supposed to be added.
If the user do not care what extension to give, then we can give any extension, and so use the most reasonable format according to us.

Quote
But, I can tell for myself that most of the time I do not need transparency and it is quite problematic, because I have to keep filling it with colour. So I would not like to save a JPG as a PNG and vice versa.
Of course, if you select JPG, it is saved as JPG, not PNG. However JPG is lossy, so even for an opaque image, I would not recommend it unless you have the intention to give a small file to someone else for example.

Quote
I read somewhere that you prefer an application without a settings dialogues, but maybe LazPaint became too big to do without it.
Yes. If we have different opinions on how the application should behave, we can put it in configuration as a choice.

Quote
So there might be a checkbox to set extension permanently (for the session) to the new value. But that means that a custom SaveDialog shallbe used, which sounds like a lot of time.
Well, yeah no I don't want to do a custom SaveDialog.

Quote
Generally in this case I proceed with batch processing- convert everything in the output format and then edit it.
Yes I understand, however it takes some time to set up a batch processing if you just have a few files.

Quote
I would like to ask if working in a transparencyless mode could take less resources (mempory, CPU, etc). And how hard it would be to do implement it?
No currently it would not be a significant optimisation. And in fact, you don't need a transparencyless mode. You can fill the background with a color. If you still want to use the eraser, you can add a background layer with the color of the background (or an image if you like).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on August 05, 2014, 07:59:54 am
Quote
I read somewhere that you prefer an application without a settings dialogues, but maybe LazPaint became too big to do without it.
Yes. If we have different opinions on how the application should behave, we can put it in configuration as a choice.
 
It should rather be if users have different opinions how the application should behave. Oddly, LazPaint was downloaded more than 2000 times this week (it still Tuesday), and there is no user feedback here. Maybe there is a discussion on somewhere else?
Quote
Generally in this case I proceed with batch processing- convert everything in the output format and then edit it.

 

Yes I understand, however it takes some time to set up a batch processing if you just have a few files.
 


I usually have a hundred at least :)
Quote
I would like to ask if working in a transparencyless mode could take less resources (memory, CPU, etc). And how hard it would be to do implement it?
No currently it would not be a significant optimisation. And in fact, you don't need a transparencyless mode. You can fill the background with a color. If you still want to use the eraser, you can add a background layer with the color of the background (or an image if you like).

What I usually do is to delete a significant area of the image. Than I have to remove the transparency layer. That's why I have added a keyboard shortcut for Clear alpha channel and set background. But if there was/is a way that deleted area gets the background colour automatically, it would be much easier and probably faster.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 05, 2014, 09:52:56 am
It should rather be if users have different opinions how the application should behave. Oddly, LazPaint was downloaded more than 2000 times this week (it still Tuesday), and there is no user feedback here. Maybe there is a discussion on somewhere else?
Yes it is not easy to get feedback. Some time ago, I was thinking about adding a feedback feature directly in LazPaint.

Quote
What I usually do is to delete a significant area of the image. Than I have to remove the transparency layer. That's why I have added a keyboard shortcut for Clear alpha channel and set background. But if there was/is a way that deleted area gets the background colour automatically, it would be much easier and probably faster.
Would drawing shapes with this background colour not work?

Maybe we can add a function to fill the selection?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 05, 2014, 12:08:39 pm
Oh I found a bug: when we choose to move a layer, and then select another layer without moving the first layer, and that the layers do not have the same bounds, then the bounds are not updated.

So we need to do a version 6.1 with bug fixes only or very small changes.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 07, 2014, 07:08:02 pm
Hello people,

Here is quick update to fix a bug and take recent feedback into account. It is version 6.1. When you help me to compile, think about updating BGRABitmap too (7.7).

Here are all the zip files:
http://sourceforge.net/projects/lazpaint/files/src/lazpaint6.1_src.zip/download
http://sourceforge.net/projects/lazpaint/files/src/bgrabitmap7.7.zip/download
http://sourceforge.net/projects/bgra-controls/files/bgra-controls-3.0/bgra-controls-3.2-20140421.7z/download
http://sourceforge.net/projects/lazpaint/files/src/inet0.6.6.zip/download

Here is the list of changes. Major bug fixes:
- fixed a bug that could corrupt the content of the layer being moved
- fixed a bug with 3d rendering that can almost crash the program when there is no normal vector
- fixed a memory leak with noise filter

Improvements:
- image is zoom out if it is too big when loading
- the image browser size is saved in configuration
- the size of the image is shown in the window title
- fixed bugs when typing in numeric updowns
- added (+)/(-) in the pen preview for easy change of pen size
- added a numeric updown for the size of the text tool
- do not resize icons if dpi of the screen is almost the same as the original
- optimisation of text rendering when it is big
- custom component for numeric updowns in order to add a horizontal bar and to have the same aspect on windows and linux

Linux fixes:
- hide topmost windows when using filters (linux-friendly)
- cursor fix for linux when the mouse is in the toolbars

Here are screenshots of both Windows and Linux version with the custom component for numeric updown:
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 07, 2014, 08:19:25 pm
I compiled for win32 and linux32. I would need some help for win64 and linux64.

MacOS compilation can wait, we need to first solve a problem with the interface:
http://forum.lazarus.freepascal.org/index.php/topic,25395.msg154179.html#msg154179
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 10, 2014, 05:21:15 am
I was able to test it on Linux Mint an Zorin OS and I have found some incompatibilities. So I am trying to fix this now...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 10, 2014, 10:42:22 pm
Ok so here is a version 6.2 with:
- fix for access violation with circle selection
- fix for big font with phong crashes
- fix for font size in labels toolbar
- fix for about box too small horizontally

Linux fixes:
- fix for popup message, not all letters were shown
- fix for cursor not updated outside image zone
- fix for colors>curve crashes
- fix for shift colors bar clipped
- fix for semaphore init failed in threaded filter

Source:
http://sourceforge.net/projects/lazpaint/files/src/lazpaint6.2_src.zip/download

Hopefully this version is ok.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 11, 2014, 10:32:37 am
Binaries for Linux:
32-bit gtk: http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.2_i386-linux_gtk2.tar.gz/download
32-bit qt: http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.2_i386-linux_qt.tar.gz/download
64-bit gtk: http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.2_x86_64-linux_gtk2.tar.gz/download
64-bit qt: http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.2_x86_64-linux_qt.tar.gz/download

Binaries for Windows:
install: http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.2_setup_win32_win64.exe/download
32-bit: http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.2_win32.zip/download
64-bit: http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.2_win64.zip/download

Package for Puppy Linux:
SFS: http://sourceforge.net/projects/asriedu/files/asriedu_packages/asriedu_packages_31x_base_puppyprecise5xx/lazpaint6.2_i386-linux_gtk2_asri20140810_310.sfs/download
PET: http://sourceforge.net/projects/asriedu/files/asriedu_packages/asriedu_packages_31x_base_puppyprecise5xx/lazpaint6.2_i386-linux_gtk2_asri20140810.pet/download
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: zehess on August 14, 2014, 08:08:01 pm
Hi,
I have problems to open lzp/ora files. Following message appears:
-The file format has not been regognized
-Can not load file ....
That happens with LazPainz portable and installed versions (6.0 and also 6.2).
No Problems wit jpg,png, gif and pdn files. Running Win8, any ideas?

Thanks CS

EDIT, 19.Aug.14: [solved] after recompiling the win_64bit exe, everything is fixed! Thanks.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 14, 2014, 10:44:58 pm
Can you send me a copy of a file you cannot open?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on August 16, 2014, 08:21:57 pm
I have attached a patch for LazPaint. Changes description is inside.
Please let me know if there is some problem with it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 17, 2014, 10:53:31 pm
Thank you. I am going to have a look more in details.  8-)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 19, 2014, 07:23:43 pm
I have applied the changes, except for:
Quote
2. Save as dialog extension handling improvents. Commented until Settings windows is implemented.

We need to do the following:
- check the extension index from the filter defined for the dialog

It reminds me that we would like to do:
- have the list of formats that can be read
- have the list of formats that can be written
- creating the strings for the opendialogs using the functions that provide different cases for the extensions (however I am not sure anyway that we need to provide really all cases, as basically only the following are encountered "BMP, Bmp and bmp", an extension like "bMp" or "bMP" could safely be ignored)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on August 19, 2014, 09:21:15 pm
I have applied the changes, except for:
Quote
2. Save as dialog extension handling improvents. Commented until Settings windows is implemented.

We need to do the following:
- check the extension index from the filter defined for the dialog
 


You mean that if the extension is written manually the app should know to use that extension?
So if the user types image.png, the file will be automatically saved as PNG? Or you mean sth. else?
 


- creating the strings for the opendialogs using the functions that provide different cases for the extensions (however I am not sure anyway that we need to provide really all cases, as basically only the following are encountered "BMP, Bmp and bmp", an extension like "bMp" or "bMP" could safely be ignored)
Well, I have already written this fuction in the imagelist form, it just needs to be moved to a more global unit. It has a shortcomming, that it does not ignore noncaseble chars (numbers, punctations, etc) which I will fix one day but that is not a bug indeed.
 

 an extension like "bMp" or "bMP" could safely be ignored)
 

I seen no benefit from ignoring them.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 20, 2014, 01:31:23 am
You mean that if the extension is written manually the app should know to use that extension?
So if the user types image.png, the file will be automatically saved as PNG? Or you mean sth. else?
No, I am talking about computing the index of the extensions by going through the filter string (the Filter property of the TOpenDialog/TSaveDialog). This way we can be sure that the index correspond to the extension. The Filter property need to contain the extension and moreover, the list may be different depending on the dialog box.

Quote
Well, I have already written this fuction in the imagelist form, it just needs to be moved to a more global unit. It has a shortcomming, that it does not ignore noncaseble chars (numbers, punctations, etc) which I will fix one day but that is not a bug indeed.
Yes.

Quote

 an extension like "bMp" or "bMP" could safely be ignored)

I seen no benefit from ignoring them.
Yeah, I don't know if there could be a slow down let's say if we have a directory of thousands of files and each extension having 16 masks (*.abc; *.Abc, etc.). I reckon the beauty of generating all possible cases, but I am not sure it is reasonable. I propose you to go on with the code you wrote, and test it on Linux. I can test it on Puppy Linux and on Linux Mint. For Windows, this is better not to do it because it is not case sensitive. We can do that with a {$IFNDEF WINDOWS}
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on August 20, 2014, 09:53:48 am
I found out is a huge problem in LazPaint. When an indexed image is open (let's say 1bpp, or strictly black and white it is automatically converted to RGB). And after saving it takes significantly more disk space.
If LazPaint cannot work in other mode than RGB, I suppose that a warning message should be shown, when a non RGB image is open.


No, I am talking about computing the index of the extensions by going through the filter string (the Filter property of the TOpenDialog/TSaveDialog). This way we can be sure that the index correspond to the extension. The Filter property need to contain the extension and moreover, the list may be different depending on the dialog box.
 


I'll take care for that.
Quote
Well, I have already written this fuction in the imagelist form, it just needs to be moved to a more global unit. It has a shortcomming, that it does not ignore noncaseble chars (numbers, punctations, etc) which I will fix one day but that is not a bug indeed.
Yes.

Quote

 an extension like "bMp" or "bMP" could safely be ignored)

I seen no benefit from ignoring them.
Yeah, I don't know if there could be a slow down let's say if we have a directory of thousands of files and each extension having 16 masks (*.abc; *.Abc, etc.). I reckon the beauty of generating all possible cases, but I am not sure it is reasonable. I propose you to go on with the code you wrote, and test it on Linux. I can test it on Puppy Linux and on Linux Mint. For Windows, this is better not to do it because it is not case sensitive. We can do that with a {$IFNDEF WINDOWS}

I will test in on XUBUNTU. Indeed, it should better be skipped in Windows. Actually I was wondering if handling non-caseble extensions would require less or more resources. So you'd better wait until I add this fucntionality before starting tests. Maybe we could ask other people to test in the Linux section. It's a general issue.
EDIT: Actually it is the file system that is case sensitive, not the OS. A FAT32 system mounted on should be case insensitive, which is quite common (USB devices, etc). Respectively an EXT2 FS, mounted on Windows will be case sensitive, which is quite a rare cse, IMHO, so indeed disabling AllExtension on Windows won't cause many problems. Anyway, it's worth testing. If no significant delay occurs, it could stay.

The best solution would be to act according the FAT, but AFAIK a standard dialog won't do that so the world will have to do without it ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 20, 2014, 01:38:05 pm
I found out is a huge problem in LazPaint. When an indexed image is open (let's say 1bpp, or strictly black and white it is automatically converted to RGB). And after saving it takes significantly more disk space.
If LazPaint cannot work in other mode than RGB, I suppose that a warning message should be shown, when a non RGB image is open.
I understand. We can update the writers to reduce the number of colors in the output file. I can take care of that. What format in particular did you use as an input?

Quote
I will test in on XUBUNTU. Indeed, it should better be skipped in Windows. Actually I was wondering if handling non-caseble extensions would require less or more resources. So you'd better wait until I add this fucntionality before starting tests. Maybe we could ask other people to test in the Linux section. It's a general issue.
EDIT: Actually it is the file system that is case sensitive, not the OS. A FAT32 system mounted on should be case insensitive, which is quite common (USB devices, etc). Respectively an EXT2 FS, mounted on Windows will be case sensitive, which is quite a rare cse, IMHO, so indeed disabling AllExtension on Windows won't cause many problems. Anyway, it's worth testing. If no significant delay occurs, it could stay.
I did not think of that mounting of EXT on Windows. Yes if Windows can take it, it would be better to keep it on this platform too.

Quote
The best solution would be to act according the FAT, but AFAIK a standard dialog won't do that so the world will have to do without it ;)
Oh ok, well, that may be a bit complicated. :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on August 20, 2014, 09:54:17 pm
...If LazPaint cannot work in other mode than RGB, I suppose that a warning message should be shown, when a non RGB image is open.
I understand. We can update the writers to reduce the number of colors in the output file.
 

I thinks it's not that simple. For example, if you open a file with a custom palette of let's say 20 colours, and you open it in RGB mode, care should be taken that only the available indexed colours should be used. Maybe some restricted colour palettes could be used as a beginning. Anyway, probably real indexed mode could take less resources than RGB.
 

I can take care of that. What format in particular did you use as an input?
 


I opened some PNGs. I think JPG does not support indexed colours.
 
... Respectively an EXT2 FS, mounted on Windows will be case sensitive, which is quite a rare cse, IMHO, so indeed disabling AllExtension on Windows won't cause many problems. Anyway, it's worth testing. If no significant delay occurs, it could stay.
I did not think of that mounting of EXT on Windows. Yes if Windows can take it, it would be better to keep it on this platform too.
 
   

It can, with some additional drivers. BTW, the function is ready, I will post it here tomorrow.
 
The best solution would be to act according the FAT, but AFAIK a standard dialog won't do that so the world will have to do without it ;)
Oh ok, well, that may be a bit complicated. :D 


Since you have a custom file opening dialogue, it might not be so complicated, but anyway, time can be used for sth. more useful.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 20, 2014, 10:24:54 pm
I thinks it's not that simple. For example, if you open a file with a custom palette of let's say 20 colours, and you open it in RGB mode, care should be taken that only the available indexed colours should be used. Maybe some restricted colour palettes could be used as a beginning.
I understand. It is a bit out of the scope of LazPaint.

Quote
I opened some PNGs. I think JPG does not support indexed colours.
Probably PNG is not automatically used with indexed mode.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on August 21, 2014, 01:39:15 pm
I thinks it's not that simple. For example, if you open a file with a custom palette of let's say 20 colours, and you open it in RGB mode, care should be taken that only the available indexed colours should be used. Maybe some restricted colour palettes could be used as a beginning.
I understand. It is a bit out of the scope of LazPaint.

Actually maybe there is a way of reaching some decent result- when indexed colour is used (black and white, grayscale, custom palette), instead of the current colour selection palette a custom one shall be made. But I don't think I could help in this area, at least in the next year.
And here are the allcase functions:
Code: [Select]
...uses ... LazUTF8...
//All case extension subs
//TODO: Extensions containing non-caseable chars will be duplicated
function GetBit(Value: QWord; Index: Byte): Boolean;
begin
  Result := ((Value shr Index) and 1) = 1;
end;

{en Converts aChar to uppercase if aUcase= true. No conversion is done if aUcase= false}
function UCase(aChar: string; aUcase: Boolean): string;
begin
  if aUCase then Result:=UTF8UpperCase(aChar) else Result:=aChar;
end;

{en Checks if a character is caseble}
function IsCaseble(aStr: string): Boolean;
begin
   Result:=not (UTF8LowerCase(aStr)=UTF8UpperCase(aStr));
end;

{en: Generates all possible upper and lowercase combinations of a string.
if HandleNonCaseble= true care is taken not to duplicate strings with no-caseble characters.}
function AllCases (aStr: string; Delimiter: String=';'; Prefix: string=''; Suffix: String=''; HandleNonCaseble: Boolean= True):string;
var
  FWord,FChar:integer;
  LCString: string;
  Len: integer;
  Count: integer;
  LCArray: array of String;
  CExt:string='';
  Cased: Boolean;
  CChar: String;
begin
  Result := '';
  Len:= Length(aStr);
  LCString:=Utf8Copy(UTF8LowerCase(aStr),Length(Prefix)+1, Len-Length(Suffix)-Length(Prefix));
  Len:=Length(LCString);
  Count:=(1 shl len) - 1;
  SetLength(LCArray,Len);
  for FWord:=0 to Len -1 do
     LCArray[FWord]:=Utf8Copy (LCString,FWord+1,1);
  if HandleNonCaseble then
  begin
     for FWord:=0 to Count do
       begin
         CExt:='';
         Cased:=True;
         for FChar:=0 to Len-1 do
           begin
             CChar:=LCArray[FChar];
                if IsCaseble(CChar)
                 then CExt:=CExt+ UCase (CChar,GetBit(FWord,FChar))
                 else if not GetBit(FWord,FChar)
                    then CExt:=CExt+ UCase (CChar,GetBit(FWord,FChar))
                    else
                      begin
                         CExt:=''; Cased:= False; Break; end;
             end; //for FChar
            if Cased then
            begin
               Result:= Result+ Prefix+ CExt + Suffix + Delimiter;
            end;  //if
         end; //for FWord
      end  //if HandleNonCaseble
     else
      for FWord:=0 to Count do
      begin
        Result:=Result + Prefix;
        for FChar:=0 to Len-1 do
         begin
           Result:=Result+ UCase (LCArray[FChar],GetBit(FWord,FChar));
         end;
      Result:=Result + Suffix + Delimiter;
      end;
      Result:= LeftStr(Result, Length(Result)-1);  //Remove last Delimiter;
end;

function ExtensionAllCase (AllExtensions: String; HandleNonCaseble: Boolean= True): String;
var
  ExtList: TStringList;
  i: integer;
begin
  Result := '';
  ExtList:= TStringList.Create;
  ExtList.Delimiter:=';';
  ExtList.DelimitedText:=AllExtensions;
  for i:=0 to ExtList.Count -1 do
    Result:= Result + AllCases(ExtList[i],';','*.','',HandleNonCaseble);
  ExtList.Free;
end;
//end All case extension subs
 
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 23, 2014, 02:10:56 pm
Actually maybe there is a way of reaching some decent result- when indexed colour is used (black and white, grayscale, custom palette), instead of the current colour selection palette a custom one shall be made.
It is not so simple because the colors are merged with antialiasing and all. So it is not only about selecting the color in the palette.

Thanks for the function. I will add a unit.

About the save dialog, I discovered a bug on Linux Mint. Basically on my computer the "save as" dialog crashes the application. The reason is unknown, maybe related to having a mix of NTFS and EXT drives.

I am thinking of using the browse dialog for both opening and saving files. And use the filter strings with it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 23, 2014, 07:56:35 pm
In the (+) button in the Image List window, when the dialog is open 'all supported types' is filled of the extensions in different cases. *.bmp, *.Bmp, etc..

That's for linux or something? because in Windows is not neccesary, there's no way to have files with the same extension and different case, all are filtered the same just putting *.bmp..
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 23, 2014, 11:14:18 pm
Yes, well in fact, it is not necessary for them to be displayed as the filter text need not contain all the actual extensions. We were talking about it with Paskal if we needed to define those for Windows too. It may be useful if an EXT file system is plugged into Windows. But anyway it probably does not bother Windows. Simply we need not display them.

I had a look at the blog you created for LazPaint, that's really great, thanks alot!
http://lazpaint.blogspot.com/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 27, 2014, 08:57:54 pm
Ok!

What about 'rain' filter in LazPaint? The attached picture is available in bgracontrols\test\test_extra\rain (a nice rain animation).

Basically are vertical lines with different length and alpha values. Then I applied two filters: BlurMotion (to add a better vertical effect) and BlurRadial (to smooth a bit).

The code can be changed, for example, to rain in different angles and intensity. Also different colors will be a good idea.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 28, 2014, 04:11:28 pm
That's a good idea.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 31, 2014, 12:54:08 am
There's a bug in the file open dialog

UMySlv:
Code: [Select]
line 360:      FData[j].modification := FileDateToDateTime(age);
"2107-15-31 is not a valid date specification"

Of course a file in my documents has wrong data but it shoud skip that or something.

How to do rain in lazpaint: open an image and add a new layer, then use filter noise 'grayscale' and motion blur (vertically and a value of 60'), then use a blend mode like HardLight, Overlay or Glow and that's all. If you duplicate the layer the effect will increase.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 31, 2014, 01:50:14 pm
Thanks 007, it's fixed.

For the rain, I will add a more complete dialog box to do this effect.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 31, 2014, 04:18:15 pm
Thanks 007, it's fixed.

For the rain, I will add a more complete dialog box to do this effect.

Ok yeah!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 02, 2014, 07:11:42 pm
You have seen Sketch Guru - Handy Sketch Pad?
https://play.google.com/store/apps/details?id=com.doodlejoy.studio.sketcherguru&hl=es_419

It has an option
 "Movie" mode to playback sketch like a small film.

That show each pencil movement (is like a undo-redo list that's played, saved in a script file).

----
There's another bug in other file open dialog of 'Image List'.

I can't open any file stored in user Pictures folder. Always throw 'Error: File not found!'.

Remember that Pictures folder has a real path and a 'visual' path. One is, for example:

'C:\Users\User\Pictures'

And other is the translated, that's shown
'C:\Users\User\Mis imágenes'

(With the first two seems that there's no problem)

And other, shown when you acces the folder via explorer 'Library' shortcuts
'Bibliotecas\Imágenes'

No idea, because I can open files in 'Documents' Library folder with no problems, only the 'Pictures' Library folder has that.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on September 04, 2014, 08:54:21 am
There's another bug in other file open dialog of 'Image List'.
I can't open any file stored in user Pictures folder. Always throw 'Error: File not found!'.
Remember that Pictures folder has a real path and a 'visual' path. One is, for example:
'C:\Users\User\Pictures'
And other is the translated, that's shown
'C:\Users\User\Mis imágenes'
(With the first two seems that there's no problem)
And other, shown when you acces the folder via explorer 'Library' shortcuts
'Bibliotecas\Imágenes'
No idea, because I can open files in 'Documents' Library folder with no problems, only the 'Pictures' Library folder has that.
What is your OS?  I have no problem here  (WIN XP) , though there is another bug- trying to open a lnk file prevented filelist from loading.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 04, 2014, 06:45:00 pm
Windows 7 x64
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on September 06, 2014, 12:05:36 pm
For good or bad I have neither a PC with Win 7, nor a one which can run it.
When you try to add several files, do these files get added in the list?
Or you just just get the message and the imagelist stays empty?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 06, 2014, 08:44:42 pm
I have Win7 but I don't have this problem. Maybe it is because my Windows is in English.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on September 06, 2014, 10:15:17 pm
I installed a LIP (language interface package) on one of the XP PCs, and still there is no problem :(
Yet, in WinXP there is a problem with the OpenFile dialog. No matter what filter is selected, LNK files are shown  >:(
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 07, 2014, 05:23:57 am
I found the problem: is not the folder, there are files with extension with uppercase like .PNG or .JPG. Strange!

How to solve: add lowercase to ext in this code (UFileExtensions.pas)

function HasExtensionOptions(AFilename: string; AOptions: TExtensionOptions): boolean;
var
  ext: string;
  i : integer;
begin
  ext := ExtractFileExt(AFilename);
  ext := lowercase(ext);
  if (ext<>'') and (ext[1]='.') then delete(ext,1,1);
  for i := 0 to high(PictureFileExtensions) do
  begin
    if pos(';'+ext+';', ';'+PictureFileExtensions.extensionsWithoutDot+';')<> 0 then
    begin
      if PictureFileExtensions.options * AOptions = AOptions then
      begin
        result := true;
        exit;
      end;
    end;
  end;
  result := false;
end;
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 08, 2014, 07:42:25 pm
Well spotted Lainz. It is fixed on subversion.

paskal, I tried to put a link in an image folder, but it never appeared in the image browser nor in the standard open dialog.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on September 11, 2014, 09:23:19 am
So, the trick is that the link should be to a folder. Links to files are not shown.
So, I have set option NoDereferenceLink:= true  in the OpenDialog1 in the ImageList form. Now no error message is shown, though folders can still be selected.
Should I submit a patch or it would be more convenient for you to fix it yourself?


Still I have no way to disable folder selection.Maybe it is not possible, since it would cause problems when items are selected with ctrl+a/ shift+ shift/ mousedrag.
Maybe it should not be disabled, but images in the selected folders should be added to the list (if possible to implement).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 12, 2014, 05:02:54 pm
Please do post patches, I like patches.  :)

I would propose to use the image browser instead. This makes me think of adding CTRL-A shortcut with it!

I already replaced the OpenDialog for File>Open and for Select>Load Selection. I would like to do the same where ever an image is opened. This is in part motivated by the fact that the application crashes under Linux on those dialog boxes. However I have not found any plan for the "folder browser" dialog yet

This is not completely replace the dialogs yet as it is not the case under MacOS because it seems not to work. However, maybe the new version of the image browser would work well on MacOS too. I don't know.

I think it is safe to ignore links that may be returned by dialog boxes.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 12, 2014, 10:50:42 pm
What about FullScreen mode? Something like View > FullScreen (F11)

Code: [Select]
Form.BorderStyle:=bsNone
Form.WindowState:=wsFullScreen

This code maybe is not compatible with View > Dock layers and colors.

Edit: a cool way to have a docking toolbar
http://forum.lazarus.freepascal.org/index.php/topic,25800.msg157316.html#msg157316

And a way to theme a panel and a ttoolbar (of course maybe you already know it)
http://forum.lazarus.freepascal.org/index.php/topic,25746.0.html
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on September 13, 2014, 11:14:27 pm
Please do post patches, I like patches.  :)
 
Patch is attached.

 


I would propose to use the image browser instead.
 
I wonder if it won't become too heavy. It will give it a try.
And once again it occurs that I neither edit, nor paste in the address field. I am pretty sure I have fixed it some time ago.  :'(
Also in the open dialog several images can be selected, but only one can be open at a time. You should disable multiple items selection, unless you something unknown to me can be done with multiple selected files.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 14, 2014, 06:25:15 am
Thanks.

Well, yes you can open multiple files, by pressing Enter or clicking on the new top left button. It has the same effect as drag'n'dropping files. In fact I have added the optional multiple selection in order to make it compatible with the image list.

I guess I have not applied the change on the directory. There was some problem with the update of the list of files at that time. However now it may be ok to apply it. Thanks for bringing the subject back. I suppose you may feel sad that your contribution was not applied. Please be assured that I do try to include everything that is proposed. I may not however remember everything.

The image browser on my computer is faster to show than the open dialog, however it can be slow afterwards while making the thumbnails if there are big images. Is it what you are talking about?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme on September 14, 2014, 10:21:57 am
Why are ALL conversations about LazPaint done in this single message thread!?  It makes it impossible to find a specific topic, follow a discussion etc. %)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: BigChimp on September 14, 2014, 10:56:24 am
Perhaps somebody should start a Lazpaint newsgroup server...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on September 14, 2014, 08:26:04 pm
I suppose you may feel sad that your contribution was not applied.

I feel unpleasant when I try paste the path to a folder which I have just copied from the commander and it is not happening. So I have to spent a few minutes go there manually.
But here is the good side- I came to the idea that I might borrow the idea of some Linux DEs, which IFAIK is implemented in Win7- clicking on a part of the path leads the user directly there. I will try to find a PC with Win 7 to exactly how it is works and how to switch to edit mode.
 

The image browser on my computer is faster to show than the open dialog, however it can be slow afterwards while making the thumbnails if there are big images. Is it what you are talking about?

Exactly. I will try some tests.
Also, I'd propose to change the right arrow used for "directory up" to an up arrow, as a more common icon for that purpose.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 15, 2014, 01:13:20 pm
Yes, I understand the frustration.

I have put back the direct edit of the path. About the idea of clicking on part of the path, this can also be done by switching from text edit to this mode.

About the arrow, I just changed it to a left arrow. It was an up arrow, but it was confusing with the icon to load the files at the far left. I am also more used to the up arrow, however then for clarity I would prefer another icon to load the files.

EDIT: I applied the NoDereferenceLinks to all open dialogs I could find.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 15, 2014, 01:22:37 pm
Why are ALL conversations about LazPaint done in this single message thread!?  It makes it impossible to find a specific topic, follow a discussion etc. %)
I don't think there is a particular reason for that. Is it that you would like more clarity?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme on September 15, 2014, 03:01:49 pm
Perhaps somebody should start a Lazpaint newsgroup server...
Not sure if you meant it as a joke or not, but on a serious note. I do host a NNTP news server, and have made offers before where I said I would host newsgroups for open source projects for free. So if Lazpaint project wanted to move discussions to a NNTP news server, all they need to do is ask.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme on September 15, 2014, 03:03:28 pm
Is it that you would like more clarity?
Not just me, but yes. Somebody might search for a specific topic or issue or feature request regarding LazPaint. All you ever get is the monster of a thread. No easy way to navigate specific questions and answers. :-/
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: BigChimp on September 15, 2014, 03:06:35 pm
Perhaps somebody should start a Lazpaint newsgroup server...
Not sure if you meant it as a joke or not, but on a serious note. I do host a NNTP news server, and have made offers before where I said I would host newsgroups for open source projects for free. So if Lazpaint project wanted to move discussions to a NNTP news server, all they need to do is ask.
Of course I knew you ran a news server and that you prefer it for tiopf support. That's why I posted.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 15, 2014, 04:32:24 pm
How different is a newsgroup server from a forum?

I would be happy to have the discussions a bit more organised. In any case, I will think about creating new threads when a subject is raised here.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on September 15, 2014, 05:20:24 pm
How different is a newsgroup server from a forum?

I would be happy to have the discussions a bit more organised. In any case, I will think about creating new threads when a subject is raised here.
You are kidding right? never used nntp? Better known as usenet? here take a look on one of the most used clients
https://www.google.com/search?q=xananews+image&client=palemoon&rls=Palemoon:en-US&source=lnms&tbm=isch&sa=X&ei=JwIXVNm3HYuVarj-gvAK&ved=0CAsQ_AUoBA&biw=1366&bih=693#rls=Palemoon:en-US&tbm=isch&q=xananews&imgdii=_ (https://www.google.com/search?q=xananews+image&client=palemoon&rls=Palemoon:en-US&source=lnms&tbm=isch&sa=X&ei=JwIXVNm3HYuVarj-gvAK&ved=0CAsQ_AUoBA&biw=1366&bih=693#rls=Palemoon:en-US&tbm=isch&q=xananews&imgdii=_) I still miss the tree structure which allowed you answer specific points instead of general discussion.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: howardpc on September 15, 2014, 05:56:31 pm
A factor to bear in mind is that not all ISPs support newsgroups. For instance my ISP (talktalk.co.uk) does not, though I don't know how common this is internationally.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 15, 2014, 09:50:06 pm
Oh ok so what is more is that message have a tree structure, isn't it?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Mike.Cornflake on September 15, 2014, 09:52:51 pm
A factor to bear in mind is that not all ISPs support newsgroups. For instance my ISP (talktalk.co.uk) does not, though I don't know how common this is internationally.
Isn't this only an issue if you're using your ISPs newsgroup server?   In this case Graeme is offering use of his server...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on September 15, 2014, 11:11:08 pm
A factor to bear in mind is that not all ISPs support newsgroups. For instance my ISP (talktalk.co.uk) does not, though I don't know how common this is internationally.
My experience so far is that no isp is offering usenet access any more, and even if they do they do on a very limited set that might or might not include the comp.* tree.

Isn't this only an issue if you're using your ISPs newsgroup server?   In this case Graeme is offering use of his server...

Consider usenet something like the internet it self there are a number of nntp servers out there that each one mirrors and is been mirrored by the others you connecto to eg news.YourISP.com and subscribe to comp.algorithms.graphics.2DVectors which is host from an obscure server in australia but its mirrored by your ISP's news server for you and here start all the problems not all isps mirror everything and not everything that is mirrored is available to free users and on top of that they retain the message for a limited time something like 2 hours depending on the traffic size of the messages etc if you do not get the new messages inside that time frame you lost them, etc.
So if your ISP is not offering any news mirroring you have no usenet access but you still can access individual server if you know their address, something like the internet with out google or any search engine. Ruffly that is the situation.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: taazz on September 15, 2014, 11:14:05 pm
Oh ok so what is more is that message have a tree structure, isn't it?

no what is more is that the message are located on your computer you can have a backlog as big as you like keeping the most interesting discussions for you and even if tomorrow the 3rd world war collapses the internet infrastructure you do not loose access to your information and yes the tree structure is a nice thing to have too.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme on September 16, 2014, 01:11:06 am
How different is a newsgroup server from a forum?
Wow, I must be showing my age then. :-)


I'm sure if you spend 10 minutes on Google you will find many more reasons as to what makes NNTP good.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme on September 16, 2014, 01:19:08 am
A factor to bear in mind is that not all ISPs support newsgroups. For instance my ISP (talktalk.co.uk) does not, though I don't know how common this is internationally.
I fail to understand what you mean? Can't you access existing NNTP news servers? I'm not talking about the 10,000+ USENET groups, I'm talking about any NNTP server (eg: try and access my server - details below). I can't imagine any ISP blocks such traffic - what would be their reasoning to do that?

Or do you mean you can't host a NNTP server?  That might be the case, but you can configure a NNTP Server to listen on a non-standard port, thus easily overcoming the ISP restriction.

To test your setup, why don't you download Mozilla Thunderbird or XanaNews or Pan etc... any news client and try and access my server.
  Server name:   opensoft.homeip.net
                           ...alternatively...
                        geldenhuys.co.uk
  Port: 119
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 16, 2014, 04:12:52 am
Why are ALL conversations about LazPaint done in this single message thread!?  It makes it impossible to find a specific topic, follow a discussion etc. %)

I think it comes from the time when LazPaint did not have his own subforum. In Third Party forum..

IMHO is a good idea to separate in different threads / subforum like: bug report, suggestions, patches, releases...

Maybe circular needs to be moderator in this forum?

Using a newsgroup maybe it's ok, I don't know how much people will read the newsgroup vs read the forum (for example I will keep just reading the forum) just because I'm used to using forums, nothing more.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on September 16, 2014, 07:47:06 am

Using a newsgroup maybe it's ok, I don't know how much people will read the newsgroup vs read the forum (for example I will keep just reading the forum) just because I'm used to using forums, nothing more.
Exactly.
Besides using a less known form of communication would repel users and hinder feedback.


 
Why are ALL conversations about LazPaint done in this single message thread!?  It makes it impossible to find a specific topic, follow a discussion etc. %)

You are generally right, but as you see, you yourself did not start a separate thread for this question. :-X
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme on September 16, 2014, 09:02:32 am
I think it comes from the time when LazPaint did not have his own subforum. In Third Party forum..
That could explain it, but that isn't the case any more, yet everybody still keeps posting to this single thread - like we are doing now. :-) Yet more variation of discussions - all under one topic.

Quote
Using a newsgroup maybe it's ok, I don't know how much people will read the newsgroup vs read the forum (for example I will keep just reading the forum) just because I'm used to using forums, nothing more.
Don't you read emails? Don't you use mailing lists? If you do, you could use a Mail/News client combined - like Mozilla Thunderbird. All electronic communications in one applications. That's convenient.

Either way, I don't care to much. I just thought it wasn't the best idea to throw every topic under the sun, and the kitchen sink under a  single LazPaint (alpha-blending, antialiasing, filters) topic. That doesn't make sense to me.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme on September 16, 2014, 09:07:31 am
Besides using a less known form of communication would repel users and hinder feedback.
NNTP has a much longer history than web forums, and I have to disagree with your statement. The fpGUI, tiOPF, Embarcadero, OpenWatcom compiler and many other popular open source projects use NNTP to discuss development and support. They are all active and doing just fine.

And if you really like a web browser that much, simply use a web frontend to read NNTP news. I supply that on my server, and Embarcadero has done the same on theirs.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 16, 2014, 12:30:34 pm
I think the only way to ensure it will work is setting the server and start using it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 16, 2014, 10:55:01 pm
Thank you for all these information and debate. Yes 007, we can try and see.

I definitely think the web interface is adequate to smooth the transition with the forum. Then we will have to think about where to put the links towards this web interface. I would think it is safer to have a login system in the web interface.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 16, 2014, 11:18:39 pm
Maybe circular needs to be moderator in this forum?
I could reorganise some stuff, yes.

Quote
Using a newsgroup maybe it's ok, I don't know how much people will read the newsgroup vs read the forum (for example I will keep just reading the forum) just because I'm used to using forums, nothing more.
I will still post about last changes on the monster thread, so if you are interested by one, you could then go in the newsgroup or not. If there is a web interface, I may even put direct links to the pages, that would be accessible without login as readonly.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 17, 2014, 03:41:32 pm
Check this
http://forum.lazarus.freepascal.org/index.php/topic,25843.msg157663/topicseen.html
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 21, 2014, 08:30:07 pm
Hello! Here is a new candidate for release LazPaint 6.3. It contains essentially lots of fixes and improved usability. It does not contains much new features. This is a step towards stability.

http://sourceforge.net/projects/lazpaint/files/src/lazpaint6.3_src.zip/download
http://sourceforge.net/projects/lazpaint/files/src/bgrabitmap7.8.zip/download

I have tested it on Windows 32, Linux Mint 32 and Puppy Slacko 32.

I don't know if it works on Windows 64, Linux 64, MacOS 32 or MacOS 64.

added features:
- added "paste as new layer"
- reading BMP with Mio Map format

fixed features:
- fixed bug with blur with large radius (cf new version of BGRABitmap)
- uppercase extensions are recognized again
- improvement of image browser (you can load/save, and delete selected files by pressing DEL)
- scrollbars can now jump to a position (not clicking on the thumb but on the rest of the bar)
- bug with lang updated ignored if it happens
- translation of tabs in adjust curves
- fixed repeat image with image with a different width/height
- docking of tool windows (View menu)

Linux:
- fixed crash with open/save dialogs by using the image browser all the time
- load selection hide topmost windows
- print window fix
- fixed bug with up/down on Puppy
- image browser thumbnails update on Puppy
- keeping window borders on Puppy
- hiding topmost windows when main window is minimized on Mint
- avoid crash when switching windows on Mint

When you help me compiling, just send me the binary file of LazPaint by e-mail (the one in the readme.txt), I will take care of the rest.

Thank you all for your support
 :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 22, 2014, 09:15:53 pm
Check out LainzPaint, it just has a set of 9 brushes I made (source attached):

Enjoy!... Try to add something like this in LazPaint :)

Edit: I've thinked in a simple format, for example an INI file that stores some properties

lazpaint\brushes\pack1\pack1.ini
-----------
[Pack]
Author=someone
web=test.com
Name=package 1

lazpaint\brushes\pack1\pencil1.ini
------------
[Brush]
Name=Pencil 1
Image=pencil1.png
Width=10
Height=10
Opacity=25
BlendMode=boLinearBlend

This is simple to edit by users to add their own brushes, also separate them by folders like 'default', 'my pencils', etc.. because is a simple way to get them organized by categories.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 23, 2014, 09:26:09 pm
Nice prog. Yep. I definitely want to add brushes!  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on September 24, 2014, 01:44:47 pm
...I came to the idea that I might borrow the idea of some Linux DEs, which IFAIK is implemented in Win7- clicking on a part of the path leads the user directly there.
I am working on that, but is there someone to check if it will work on Mac?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: airpas on September 24, 2014, 03:48:37 pm
but if you draw with fast mouse motion you get spearated brushes and not straight line .
maybe using dinput will avoid this problem (at least in windows)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 24, 2014, 04:55:30 pm
but if you draw with fast mouse motion you get spearated brushes and not straight line .
maybe using dinput will avoid this problem (at least in windows)

yes, but we have X, Y, mouseOrigin.X, mouseOrigin.Y

calculating the intermediate points between them and looping the draw we can draw smoothly
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on September 24, 2014, 11:36:07 pm
I don't know if it works on Windows 64, Linux 64, MacOS 32 or MacOS 64.
I compiled on MasOS32 (PPC) and it works. But the only thing I did was to fill the background with #000000.
Edit: It occurs that it does not use the custom open control but the Mac Os inbuilt one :'(
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 26, 2014, 11:59:44 pm
Yes Paskal. I explained there how to test this feature:
http://forum.lazarus.freepascal.org/index.php/topic,25395.15.html
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on September 30, 2014, 03:21:15 am
It works on win 7 x 64 as far as i tested. There is no automatic test or something?

In spanish blur can be translated as desenfoque
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 30, 2014, 10:24:31 pm
It works on win 7 x 64 as far as i tested. There is no automatic test or something?
Nope. It relies only on you and me. I don't even have a 64-bit computer, so automatic testing, well, no.

Quote
In spanish blur can be translated as desenfoque
Why, isn't it translated?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 01, 2014, 04:54:33 am
Ok. It will be hard to implement automatic testing, with images there's no such predictable scenes.. you must see the result.
And yes seems that is translated, why in the world I thought it was not translated? ::)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 12, 2014, 06:48:34 pm
Hello folks. I have added arrows. I have made a new zip file:
http://sourceforge.net/projects/lazpaint/files/src/lazpaint6.3b_src.zip/download

It needs latest BGRABitmap (7.9.2):
http://sourceforge.net/projects/lazpaint/files/src/bgrabitmap7.9.2.zip/download
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 14, 2014, 12:21:11 pm
I see in LazPaint sources some scripting files...

You was trying to add scripting to LazPaint right? You will continue these files or just use pascal script?

Also if pascal script is used in LazPaint, wich functions it will come?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 14, 2014, 11:35:43 pm
I was thinking about adding a particular scripting language, that would be designed for images, and that would use a kind of JSON. This particular JSON is already implemented and used to store some config.

Pascal script could also be available, and what you have started could be a good candidate for that.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 14, 2014, 11:47:33 pm
Nice! How that language will look? I know JSON but I can't imagine it as scripting language..

Wait, just searched and there is JSON Photoshop Scripting
http://www.tonton-pixel.com/blog/json-photoshop-scripting/

Seems that is just different from I'm used to read.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 15, 2014, 12:00:31 am
Yes, well it would not be as complicated as Photoshop JSON, however the idea that remains is that parameters need not be simple type like integer or lists or predefined records, but can be made on the fly using JSON syntax. Note that this does not entail a particular base language, it can be Basic-like, C-like or Pascal-like.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 15, 2014, 03:59:27 am
Ok it's a dynamic language. The parameters can be constructed "on the fly" (or downloaded from internet, etc)..
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 15, 2014, 05:03:11 pm
It's not necessarily online. By on the fly, I mean that you don't need to define a record type, you can just type the starting { and then values and included other { } inside it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 15, 2014, 05:28:53 pm
I know, like in javascript.
Downloading a json i say as an option...
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 15, 2014, 10:37:49 pm
Yes. I think I misread your post.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 15, 2014, 11:11:00 pm
Don't worry. I usually do several reads, because it's in english :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on November 12, 2014, 08:42:38 am
There is a problem with the LazPaint installer for Win- it requires administrator rights, which are actually not needed, since it does not install anything in the Windows folder.
A patch fixing the problem is attached.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 12, 2014, 10:51:14 am
In fact it requires administrator privileges to write to registry HKLM: it needs to be written in order to add to "Default Programs" tool. That will not work if written to HKCU.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on November 12, 2014, 11:00:49 am
I just checked the registry entries- if I am not wrong they only register file associations.
I found this article (http://www.kinook.com/blog/?p=53), explaining what to do in such cases.
Maybe a message "Installer cannot create file associations, because it is not started with administrator rights. Restart installer from an administrator account or click "Next" to proceed without creating file associations"? If you are okay with that, I will try to do it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 12, 2014, 11:15:31 am
Well, no: it also add data to Default Programs. I know because i'm the initial author of that script.

I suggesetd to use my file association component http://wiki.freepascal.org/FileAssociation
And you can easily check if worked to write HKLM else use HKCU.

Code: [Select]
var
  app: TFileAssociation;
...
// if HKLM doesn't works try HKCU
  if not app.Execute then
  begin
    app.RegisterForAllUsers := False;
    app.Execute;
  end;   

BTW we can just duplicate file association and change HKLM to HKCU in the current script. Just the Default Programs will not work, the other file association will be made the same for the current user only.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on November 12, 2014, 12:24:25 pm
Should not LazPaint take care for the associations itself, instead of relying on the installer?
For example this can be done of first start and also it could detect if some associations get „stolen“ by another app.


Btw, I cannot compile it due to:
ubrowseimages.pas(385,26) Error: function header doesn't match any method of this class "TFBrowseImages.FormUTF8KeyPress(TObject,var TUtf8Char);"

Any idea what could be wrong, everything seems okay.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 12, 2014, 04:16:44 pm
Should not LazPaint take care for the associations itself, instead of relying on the installer?
For example this can be done of first start and also it could detect if some associations get „stolen“ by another app.

Already say that  :)

Quote
I suggesetd to use my file association component http://wiki.freepascal.org/FileAssociation
And you can easily check if worked to write HKLM else use HKCU.

Is not for the installer script, is for the application.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on November 13, 2014, 07:39:20 am
I am not sure that I understand your posts, but finally I got to the idea that you share my opinion:
No registry entries shall be added by the installer, and everything should be done by LazPaint itself? This way the requirement for admin rights in the installer can be removed.


Also- something for my TODO list- when a folder is dropped in LazPaint a open dialologue shall be displayed, just like when dropping multiple files. But... it should have a checkbox for recursive adding.
And some TODO, which I hope that s.o. else will do- LazPaint should have and option Main Menu->Image-> Rotate 180 degrees. But it does not %)


I still cannot get what is the problem with the code which I cannot compile. (me post from yesterday). Seems like a bug in Lazarus?
Edit:  I just added a procedure FormUTF8KeyPress event in a brand new form. No problem!??!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 13, 2014, 10:48:43 am
Yes, that's the idea.

About the error, no idea.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on November 15, 2014, 04:10:55 pm
I just try to compile in a PPC MacOS, Lazarus 2,2. Same problem as on WinXP, Lazarus 2,4.
*Circular, what have you done?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 16, 2014, 02:40:00 am
Oh I see. I had the same problem. It is because TUtf8Char is defined in two different units. I have the impression that when I fix it, it gets reverted. Maybe because it is automatically generated code. The temporary fix I found is to add "LCLType." before the type name so that it looks in the right unit. You can use Ctrl-Click to see if it is the same type in the interface and in the implementation, and where it points to otherwise.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on November 23, 2014, 09:33:38 pm
Version in SVN still does not work. Where am I to add LCLType? It is already in the USES. I edite the LFM manually, but in vain :(
But, what brought me here now- how am I to resample a layer, or there is no such feature yet?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 23, 2014, 10:44:26 pm
When adding "LCLType." you get something like this:
Code: [Select]
procedure TFMain.FormUTF8KeyPress(Sender: TObject; var UTF8Key: LCLType.TUTF8Char);
Nope, there is no feature to resample a particular layer. But you can stretch it using the perspective tool. By holding ALT, you get a rectangle that you can resize.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on November 24, 2014, 04:34:07 pm
When adding "LCLType." you get something like this:
Code: [Select]
procedure TFMain.FormUTF8KeyPress(Sender: TObject; var UTF8Key: LCLType.TUTF8Char);

Ahh, it compiles now. But why don't you apply it in the SVN?


Nope, there is no feature to resample a particular layer. But you can stretch it using the perspective tool. By holding ALT, you get a rectangle that you can resize.
I miss the Layer entry in the main menu. Does it sound reasonable to you to add it?

Also, I'd like to discuss adding dragging and dropping folders in LazPaint:
- A folder is likely to contain many files. I doubt s.o. would like to add Layers this way.
- A dialog with three buttons: (1)Add files to image list (2) Add files to image list (recursively) and (3)Cancel seem to me a proper solution.
Another way is to have two buttons  (1)Add files to image list and (2)Cancel plus a checkbox Add recursively  but it would require a custom dialogue form.
What do you think?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 27, 2014, 03:12:20 pm
When adding "LCLType." you get something like this:
Code: [Select]
procedure TFMain.FormUTF8KeyPress(Sender: TObject; var UTF8Key: LCLType.TUTF8Char);

Ahh, it compiles now. But why don't you apply it in the SVN?
I suppose Lazarus removes it before I commit changes to the repository. Also in the last version, it does not seem necessary.

Here, I have updated the repository with "LCLType." if that may help.

Well, it could be possible to add a layer menu, but there are already many menus. I plan to make menus customisable, so that it would be easy to add it.

About drag'n'dropping folders, why not. About creating a new form with a checkbox, I think it would be easier to understand because the label could be "add subfolders recursively" and anyway the custom dialog of lazarus is buggy so it would be good to have a specific form instead. I think we can keep the "add layers" option in it, and so this form would be shown in all cases. The checkbox would be hidden if it is not a directory.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on November 29, 2014, 07:28:19 am
When adding "LCLType." you get something like this:
Code: [Select]
procedure TFMain.FormUTF8KeyPress(Sender: TObject; var UTF8Key: LCLType.TUTF8Char);

Ahh, it compiles now. But why don't you apply it in the SVN?
I suppose Lazarus removes it before I commit changes to the repository. Also in the last version, it does not seem necessary.
 

So after all, it' a bug in the current version of Lazarus?

Well, it could be possible to add a layer menu, but there are already many menus. I plan to make menus customisable, so that it would be easy to add it.
 

I'd rather unite Filter and Render and Edit and Select, because they seem to me functionally close. Select is after all a part of Edit. Well, customizable menus are always a plus.

About drag'n'dropping folders, why not. About creating a new form with a checkbox, I think it would be easier to understand because the label could be "add subfolders recursively" and anyway the custom dialog of lazarus is buggy so it would be good to have a specific form instead. I think we can keep the "add layers" option in it, and so this form would be shown in all cases. The checkbox would be hidden if it is not a directory.
I hope I will be able to start working on that after 17.XII.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 29, 2014, 11:14:17 am
So after all, it' a bug in the current version of Lazarus?
I don't know, I am a bit confused about what is happening with that.  %)

Quote
I'd rather unite Filter and Render and Edit and Select, because they seem to me functionally close. Select is after all a part of Edit.
It is a good point.

Quote
Well, customizable menus are always a plus.
Yep.  8)

Quote
I hope I will be able to start working on that after 17.XII.
Ok.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: kealon on December 03, 2014, 07:12:45 am
Good day
Some not true in TBGRAGradientTriangleScanner (attached image 1.png)

Left with bellow equation, Right - original

expression easier  (attached image image001.png)

BGRABitmap v7.5
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on December 05, 2014, 04:07:43 pm
I suppose there is a difference because TBGRAGradientTriangleScanner takes gamma correction into account, hence there is less dark area.

Note: for readability, please create a separate thread when raising a specific subject.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on January 14, 2015, 08:46:01 am
I have started making a modified QuestionDialog, based on the one of Lazarus.
It occurred to be more time consuming than I expected, since I have to find all components used bu Lazarus. Probably I will have to unite them, clean what is not needed etc.
Modification that I intend to make to  QuestionDialog are:
1. Add a property to disable icons on buttons.
2. Add a popup menu, containing "Copy message to clipboard" which will be very useful for reporting errors. My initial idea was to use a Memo to show the message, but it occurs that getting rid of the blinking cursor will take some more time.
3. Add support for a checkbox. My idea is that one of the first bits of the result should be set to 1 if the checkbox is checked.
Do you think that one checkbox is enough? I could add more than one but I wonder if a second one would be ever needed.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on February 06, 2015, 10:15:45 am
 I just tried to select a rectangular area in an image created from the buffer and I got a "division by zero" error. I restarted Lazpint and I got the same error.
Have you come across this bug, I shall try to investigate it myself?
EDIT: I updated the svn and with the new build the problem does not exist.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on February 20, 2015, 09:50:02 am
Not to forget- I started adding text to an image, but I cannot type +, because typing it zooms the image. I will check if this is not fixed in a later version.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 02, 2015, 04:26:56 pm
Hello folks,

Here is a new version of LazPaint 6.4 with some fixes and the following new features:
- Loading 3d models with texture (two example models are provided)
- Added "brush tool": you can specify the shape of the brush, load it from a file
- Added "clone tool": right click to set source location, and left click to duplicate
- Added palette toolbar: load/save palettes in various formats, posterize or dither image
- In color window: add color to the palette, preview of current color
- Less toolbars by default: right-click on top-left toolbar to add/remove toolbars
- Toolbox is docking inside the main window (left or right side)
- Save file as PNG/JPG/BMP: choose color depth and preview image & file size
- Added "rain" rendering (menu Render)

Please test and compile for your platform! Dont forget to get latest version of BGRABitmap (8.1).

Source code:
http://sourceforge.net/projects/lazpaint/files/src/lazpaint6.4.1_src.zip/download
http://sourceforge.net/projects/lazpaint/files/src/bgrabitmap8.1.zip/download

Binaries:
http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.4.1_win32.zip/download
http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.4.1_win64.zip/download
http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.4.1_setup_win32_win64.exe/download
http://sourceforge.net/projects/lazpaint/files/bin/lazpaint6.4.1_linux32.tar.gz/download

EDIT: the code would not compile because of type interference of TUTF8Char. This is fixed on SVN and in the zip files.
EDIT: applied some fixes for linux version
EDIT: some fixes so now it is version 6.4.1. Also there are some problems with Mac version: http://forum.lazarus.freepascal.org/index.php/topic,12037.msg173743.html#msg173743
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 02, 2015, 04:29:13 pm
I just tried to select a rectangular area in an image created from the buffer and I got a "division by zero" error. I restarted Lazpint and I got the same error.
Have you come across this bug, I shall try to investigate it myself?
EDIT: I updated the svn and with the new build the problem does not exist.
Yes it is fixed.

Not to forget- I started adding text to an image, but I cannot type +, because typing it zooms the image. I will check if this is not fixed in a later version.
It is fixed as well.

Do you think that one checkbox is enough? I could add more than one but I wonder if a second one would be ever needed.
I would say that if more checkboxes are necessary, chances that a whole special window is necessary.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on April 02, 2015, 11:13:18 pm
Hi, There is a problem compiling:

ubrowseimages line 393

Code: [Select]
ubrowseimages.pas(393,26) Error: function header doesn't match any method of this class "TFBrowseImages.FormUTF8KeyPress(TObject,var TUtf8Char);"

ubrowseimages.pas(51,15) Hint: Found declaration: TFBrowseImages.FormUTF8KeyPress(TObject,var TUTF8Char);

It's weird because everything seems fine. I have lazarus 1.2.6 32 bit.

I see this:
- When I ctrl-click the "TUTF8Char" that is in the header of the class, it takes me to "LCLType" unit
- When I ctrl-click the "TUTF8Char" that is in the function in the body of the document, it takes me to "Masks" unit

The interface section is using LCLType and the implementation is using Masks.
The type is almost the same, but in Masks is lowercase "TUtf8Char = String[7];". Also in the LCLType there are more conditionals like "$IFDEF USE_UTF8BIDI_LCL"

I moved "Masks" from implementation to interface and now works. You can do ", Masks, LCLType;" or ", LCLType, Masks;". I don't know if this was fixed in Lazarus SVN and the problem exists only in this release version.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 02, 2015, 11:29:55 pm
Ok for putting Masks before LCLType.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 03, 2015, 11:20:00 am
Description of the tools of version 6.4
(to be tested and compiled (http://forum.lazarus.freepascal.org/index.php/topic,12037.msg173419.html#msg173419))

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
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular 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?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz 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!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: airpas on April 11, 2015, 10:44:49 am
bgrabitmap still slower than Aggpas and Graphics32
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular 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.?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: loopbreaker 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.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme 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 (http://www.kanzelsberger.com/pixel/?page_id=5)
2.  http://www.thebest3d.com/pixel/ (http://www.thebest3d.com/pixel/)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular 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.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular 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?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme 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.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular 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.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme 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.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular 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?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme 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.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 13, 2015, 05:27:11 pm
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.
Yes, that is the goal and if that were true, that would make things easier.

Quote
That is how fpGUI works - 99.99% of all fpGUI based applications have no IFDEF's needed in the application code.
Are you suggesting to change the GUI of LazPaint and to use fpGUI?

If I set LazPaint to fpGUI, I get the following error:
fpgui\fpguiwsdialogs.pp(39,3) Fatal: Can not find unit fpg_base used by FpGuiWSDialogs.

I am not sure if BGRABitmap works with fpGUI either.

I like the idea of having a single widgetset, and at the same time, I like that the program interface blends into the operating system. With the mac version, it looks like mac interface and I am happy with that. The problems that cannot be solved are related to components that do not provide some features or that are buggy. A part from that, the tweaks work fine. Also some things are not purely a matter of widgetset. For example, on mac, OK and Cancel buttons are switched.

If fpGUI provides everything that is needed, it could be used for MacOS to avoid the following problems: ComboBox not providing ownerdraw, save dialog returning an invalid path.

Are there example applications running with fpGUI?

Another solution is to use custom drawn controls when there are some compatibility problems. For now, the combobox of CustomDrawn package does not seem to work.

For FreeBSD, if it is similar to linux, it is possible that it would not be much work to adapt and compile LazPaint. Maybe just by doing the following:
Code: [Select]
{$IFDEF LINUX}{$DEFINE LINUXLIKE}{$ENDIF}
{$IFDEF FREEBSD}{$DEFINE LINUXLIKE}{$ENDIF}
And then by replacing IFDEF LINUX by IFDEF LINUXLIKE.

Quote
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.
Ok. I have looked at some screenshot using google search, it looks indeed like Linux. So I will apply the same level of antialiasing.

Quote
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.
Ok, but please try BGRABitmap separately. Test programs are provided on LazPaint code repository.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme on April 14, 2015, 11:30:40 am
Are you suggesting to change the GUI of LazPaint and to use fpGUI?
No, just stating the pitfalls with LCL and the false promises of write once, compiler everywhere. Other toolkits seem to manage that better than LCL.

Quote
If I set LazPaint to fpGUI, I get the following error:
fpgui\fpguiwsdialogs.pp(39,3) Fatal: Can not find unit fpg_base used by FpGuiWSDialogs.
That's the LCL-fpGUI widgetset interface which I don't work on. Yes I contribute a patch here and there, but I prefer to use fpGUI directly (no LCL involved). This greatly reduces the executable size and has faster performance.

Quote
I am not sure if BGRABitmap works with fpGUI either.
I've never looked at the BGRABitmap code so don't know the internal design or dependencies. I can add that I, and many others, have easily ported LCL and VCL components to fpGUI.

But thinking about it, if BGRABitmap has a similar clean design as AggPas, then it shouldn't be a problem. AggPas is totally toolkit independent. There is just a small unit that brings AggPas+fpGUI or AggPas+LCL together (to convert the AggPas image buffer to the toolkit's TfpgImage or TImage), but they have no impact on the workings of AggPas itself. eg: I use AggPas easily for console apps too, like for generating graphs via a CGI app.

Quote
Are there example applications running with fpGUI?
DocView (help viewer), UI Designer (visual forms designer), Maximus IDE (demo IDE) etc. fpGUI also has a lot of demos included.

Quote
Another solution is to use custom drawn controls when there are some compatibility problems. For now, the combobox of CustomDrawn package does not seem to work.
The LCL-CustomDrawn is still pre-alpha stage as far as I'm concerned. It is definitely not in a usable state at the moment and still needs a lot of development work. Even the basic TEdit is still incomplete with mouse support, no default popup menu etc.

Quote
Ok, but please try BGRABitmap separately. Test programs are provided on LazPaint code repository.
I'll let you know as soon as I have a moment.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 14, 2015, 12:34:43 pm
No, just stating the pitfalls with LCL and the false promises of write once, compiler everywhere. Other toolkits seem to manage that better than LCL.
Well it is a compromise to use the widgetset of the system.

Quote
Quote
If I set LazPaint to fpGUI, I get the following error:
fpgui\fpguiwsdialogs.pp(39,3) Fatal: Can not find unit fpg_base used by FpGuiWSDialogs.
That's the LCL-fpGUI widgetset interface which I don't work on. Yes I contribute a patch here and there, but I prefer to use fpGUI directly (no LCL involved). This greatly reduces the executable size and has faster performance.
I understand, however without this, it is much work to adapt an application to fpGUI. I see you did a great job with fpGUI and it would get much more recognition and usage with a seamless integration in LCL.

Quote
Quote
I am not sure if BGRABitmap works with fpGUI either.
I've never looked at the BGRABitmap code so don't know the internal design or dependencies. I can add that I, and many others, have easily ported LCL and VCL components to fpGUI.

But thinking about it, if BGRABitmap has a similar clean design as AggPas, then it shouldn't be a problem.
BGRABitmap depends on the LCL. So you would say it is dirty?

For me, it provides a bridge between different technologies: TBitmap, TCanvas, TFPImage, TFPImageCanvas and of course TBGRABitmap, TBGRACanvas, TBGRACanvas2D.

Quote
AggPas is totally toolkit independent. There is just a small unit that brings AggPas+fpGUI or AggPas+LCL together (to convert the AggPas image buffer to the toolkit's TfpgImage or TImage), but they have no impact on the workings of AggPas itself. eg: I use AggPas easily for console apps too, like for generating graphs via a CGI app.
That would be great to have an independent version of BGRABitmap as well. However I would like it to be one library. So maybe this could be possible with compiler directives.

There is some challenge here, to do text rendering without LCL. For now, BGRABitmap uses TBitmap to render text.

Quote
DocView (help viewer), UI Designer (visual forms designer), Maximus IDE (demo IDE) etc. fpGUI also has a lot of demos included.
Congratulations, that looks great.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Graeme on April 14, 2015, 12:46:44 pm
BGRABitmap depends on the LCL. So you would say it is dirty?
Yup. ;)

Quote
That would be great to have an independent version of BGRABitmap as well. However I would like it to be one library.
It should be possible as AggPas shows. If you can get BRGABitmap independent of a GUI toolkit, I would even add it as an optional software rendering layer for fpGUI too. I've actually had requests for that before.

Quote
There is some challenge here, to do text rendering without LCL. For now, BGRABitmap uses TBitmap to render text.
AggPas accomplishes that without problem. The code is there if you want to take a peek. ;)

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 14, 2015, 06:19:07 pm
BGRABitmap depends on the LCL. So you would say it is dirty?
Yup. ;)
So we see things differently!

Quote
Quote
That would be great to have an independent version of BGRABitmap as well. However I would like it to be one library.
It should be possible as AggPas shows. If you can get BRGABitmap independent of a GUI toolkit, I would even add it as an optional software rendering layer for fpGUI too. I've actually had requests for that before.
I take a note of that.

EDIT: Conversation continued in BGRABitmap thread (http://forum.lazarus.freepascal.org/index.php/topic,24239.msg174536.html#msg174536)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on May 23, 2015, 12:01:52 pm
i do not know if this is asking too much but would it be possible for LazPaint to make the text tool editable after its been entered? at the moment the changes to the text you input seems permanent or rasterize, and also is it possible to have Layer Effects/Styles and Adjustment Layers on LazPaint similar to Photoshop? i know this will be a hard request since even GIMP does not have this 2 features of Photoshop yet

thanks for the awesome work as always sir circular!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 23, 2015, 12:04:58 pm
That's a good idea. I am not sure however how to make this compatible with OpenRaster. Text layers can still be rasterized when saved in OpenRaster. For adjustments layers, that seems less obvious.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on May 23, 2015, 12:20:33 pm
this is how Layer Effects/Styles is on Photoshop

(http://i.imgur.com/L5jt3wA.jpg)

as for Adjustment Layers being hard to do, its just a suggestion you can ignore it if its too hard, even GIMP does not have those 2 features yet (Adjustment Layers and Layer Effects/Styles) so i can understand if it will not be implemented
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 23, 2015, 12:44:46 pm
Well I can probably do many of those things. Some things may be hard to do, but many of them are simply a matter of taking some time to do it. But I am more talking here about the compatibility with OpenRaster. Basically there is a special LZP format for LazPaint, that could contain those effects, however images can also be saved as OpenRaster, which is an open source format for layered images. But then some features could not be saved in this format. That's not so important, but still it would be better to make it as much compatible as possible.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on May 23, 2015, 01:05:02 pm
ah ok, and ye i do not expect LazPaint to copy all the features of Photoshop when it comes to Layer Effects/Styles and Adjustment Layers, in the Layer Effects/Styles for example i just want the Stroke, Drop Shadow, Color Overlay and Gradient Overlay to be copied if possible but if either of them is not compatible with OpenRaster then you can ignore any of those
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 23, 2015, 01:15:59 pm
I looked up what layer effects/styles are, and it seems that it transforms the layer in itself, without interacting with other layers. So in that case, if such a feature is not available in OpenRaster, it would be possible to store the resulting layer in OpenRaster.

For example, if you draw a disk, and add a emboss effect, in the LazPaint file, it would be saved as a layer containing a disk and an emboss effect to be applied, but in the OpenRaster file, it would be saved as a embossed disk (not as an effect). So that's compatible, even if when loading the OpenRaster file, it would not possible to remove the emboss as it would be rasterized.

In fact I don't know all the effects you mentionned because I don't have Photoshop, but I will have a look at it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on May 23, 2015, 01:20:49 pm
thank you for considering it! and also can i suggest you add opacity option to layers?

i just look at OpenRaster on wikipedia too and it says the following about Layers

Layers
storage of adjustment layers
storage of layer effects
http://en.wikipedia.org/wiki/OpenRaster#Layers

so i guess its possible
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 23, 2015, 02:40:27 pm
Well those are proposed enhancements of OpenRaster. They are not really implemented yet as far as I know. This could be an opportunity to extend the format.

About Stroke and Shadow, this can only be done as effects.

About Color and Gradient Overlay, this could be done with additional blend modes and layer groups. For example a Color Overlay is equivalent to create a group of layer, with the target layer at the bottom and on top a layer filled with the color, and with a blend mode "mask".

I don't know if that would be convenient instead of having a property of the layer. This at least requires to implement layer groups. But I guess it would make it more compatible, because layer groups and blend modes are rather well defined.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: j0x on May 23, 2015, 09:40:50 pm
glad to know there are workarounds

and if you do not mind more suggestion can you add
- opacity strength option for layers
- changing font of text tool
- changing font to either bold, italic, normal depending on a font's capability
- font preview like this - http://i.imgur.com/aVxwnvJ.jpg

basically i like for LazPaint to have features like in FotoGrafix particularly this

Quote
Layers: Support for multiple layers, including non-destructive adjustment layers, masks and editable text layers

you can check out FotoGrafix here - http://lmadhavan.com/fotografix/ its only less than 1mb file size

sorry for a lot of suggestions i have made, you can ignore the suggestions that you do not like

EDIT 1:

i miss this comment

That's a good idea. I am not sure however how to make this compatible with OpenRaster. Text layers can still be rasterized when saved in OpenRaster. For adjustments layers, that seems less obvious.

im fine with that, as long as when im not saving an image or project yet then i like to have that editable text layers

EDIT 2:

ah ignore the editable text layer feature i suggested, since that one looks hard to implement because its not supported by OpenRaster
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Chronos on May 31, 2015, 10:41:50 am
deb package can be downloaded from sourceforge but it can't install on my system. First of all Software center complains about:
Lintian check results for /tmp/lazpaint6.2_x86_64-linux_gtk2.deb:
E: lazPaint: arch-independent-package-contains-binary-or-object usr/share/lazpaint/lazpaint
E: lazPaint: bad-package-name
E: lazPaint: package-not-lowercase

Then it looks like installing package but then package is not installed. But manual installation works ok. sudo dpkg -i lazpaint6.2_x86_64-linux_gtk2.deb
My system is:
$ uname -a
Linux george 3.19.0-18-generic #18-Ubuntu SMP Tue May 19 18:31:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.04
DISTRIB_CODENAME=vivid
DISTRIB_DESCRIPTION="Ubuntu 15.04"

Also I wonder if you use some "daily build" system for testing?

Also there is known problem that under Gtk2 widgetset Screen.PixelsPerInch reports just 96 even I have DPI set to 144. So it would be good to allow user to select DPI also manually. I am using Xfce as desktop environment.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 31, 2015, 01:57:24 pm
Hi Chronos!

I don't know much about linux packages. Someone made it for me.

No I don't have daily build testing.

How can one set the DPI in the LCL? LazPaint relies on LCL stretching forms.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 03, 2015, 06:48:52 am
Hi, I've updated the setup so now it has new things, see screenshot:
- Quick Edit menu
- Quick Effects menu

It must be translated also, inside the .iss, I've translated this into Spanish (but not translated the QuickEffects items.. you can grab the existing translations from LazPaint and add them all here).

Notes:
By default I've added the new menu items to .png, .bmp and .jpg filetypes. But you can uncomment the code and add to the other file formats too. I've just tested all with .png only but they all share the same code in setup and registry.

Suggestions 1:
I was thinking about adding Quick Resample menu, but of course with the current command line tools I cant resample mantaining the aspect ratio.

I want this to mantain aspect ratio:
/ResampleWidth(Width)
/ResampleHeight(Height)

So we can add a menu:
- Quick Resample
-- 1080p /ResampleHeight(1080)
-- 720p /ResampleHeight(720)
-- etc..

Also that the /ResampleWidthOut and /ResampleHeightOut to automatically include the value in the filename so the output is always:

my_filename.png
my_filename_1080.png
my_filename_720.png

Because I think the user will want to keep the original file when resampling...

Suggestions 2:

Also to create a menu called Quick Convert...

I need something like /Convert("jpg")

So I can add a menu, for example for .png files

my_file.png -> Convert to... -> jpg
out -> my_file.jpg

Suggestions 3:

Save as jpg with compress level
/CompressJPG(90)
/CompressJPGOut(90) -> my_file_compresslevel90.jpg

The thing for all suggestions is:
With the command line used in explorer I can only send a parameter that is %1 to LazPaint that is the full path to filename. The other parameters can be passed but are static and stored in registry. So I cant pass the output filename I want. It must be determined by LazPaint.

This other thing comes to my mind:
Add another menu for png files that call optipng commandline tool. Just "/OptimizePNG(level)" *level can be 0 (fast) to 7 (slow).

Maybe you can hide the commandline window of optipng and optionally show a progress window (with a progress bar that just display "working...", this can be done with the latest changes of the bgraflashprogressbar..)

There is no license problem and that feature is something I and most web developers uses and of course this setup is only for windows. Also this just add some kb to setup that are like nothing.

Bugs:
* The save dialogs of LazPaint for PNG and JPG are not HighDPI (just tested these, don't know if others are).
* The print does not work when printer is power off. CreateDC Exception.. maybe you can put a try...except block and show a message 'printer not ready'..

Suggestion:
* The setup does not contain all the formats supported by LazPaint (missing: XPM, TGA, TIFF).

Download the updated setup file, is attached.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 03, 2015, 11:04:41 am
Great stuff.  :)

Ok I see. Some commands can be added to make it easier with the command line.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 03, 2015, 07:47:29 pm
Yes, basically to have a nice right click menu for associated file types.

Attached the fix for Windows XP. In XP there is no submenu (you must create a COM .dll to add that feature, and is not so easy...). Submenu was added from Windows 7 and newer.

If you already edited the .iss file with new stuff you must add these lines for each type (if not just replace the .iss with the attached one):
Code: [Select]
; Windows XP compatibility
Root: HKLM; Subkey: "Software\Classes\LazPaint.AssocFile.bmp\Shell\CascadeMenu\Command"; ValueType: String; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; Flags: uninsdeletekey
Root: HKLM; Subkey: "Software\Classes\LazPaint.AssocFile.bmp\Shell\CascadeMenu2\Command"; ValueType: String; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; Flags: uninsdeletekey

Basically instead of throwing an error it will just open the file with LazPaint.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 03, 2015, 07:49:56 pm
Hmm ok. Not so obvious those shell customizations!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 03, 2015, 07:55:54 pm
Hmm ok. Not so obvious those shell customizations!

Ok. You can read the docs here if you want: https://msdn.microsoft.com/en-us/library/windows/desktop/hh127467%28v=vs.85%29.aspx

Also, If you want an unique menu called
- LazPaint
-- Quick Effects
-- Quick Edit
-- Etc..

Is easy as adding a SubCommands entry in the method definition (dont believe to MSDN article, ExtendedSubCommandsKey does not work...), this is a demo that adds a right click menu to your desktop to open notepad, mspaint and other stuff (found it somewhere), save as .reg file and run it.

Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\DesktopBackground\Shell\Cascading Menu]
"Icon"="C:\\Windows\\system32\\shell32.dll,-24"
"SubCommands"="A.Winver;A.Graphics.Tools.Menu;A.System.Tools.Menu;A.Text.Tools.Menu"
"Position"="Top"

; Command Store Entries

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Defrag]
"Icon"="dfrgui.exe"
"MUIVerb"="Defragmenter"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Defrag\Command]
@="dfrgui.exe"


[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Disk.Cleanup]
"Icon"="cleanmgr.exe"
"MUIVerb"="Disk Cleanup"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Disk.Cleanup\Command]
@="cleanmgr.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Disk.Tools.Menu]
"Icon"="imageres.dll,-3"
"MUIVerb"="Disk Tools"
"SubCommands"="A.Defrag;A.Disk.Cleanup"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Graphics.Tools.Menu]
"Icon"="imageres.dll,-3"
"MUIVerb"="Graphics"
"SubCommands"="A.Paint;Windows.slideshow"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Msinfo]
"Icon"="msinfo32.exe"
"MUIVerb"="Open MS Info"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Msinfo\Command]
@="msinfo32.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Notepad]
"Icon"="notepad.exe"
"MUIVerb"="Open Notepad"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Notepad\Command]
@="notepad.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Paint]
"Icon"="mspaint.exe"
"MUIVerb"="Open Paint"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Paint\Command]
@="mspaint.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.System.Tools.Menu]
"Icon"="imageres.dll,-3"
"MUIVerb"="System"
"SubCommands"="A.Msinfo;A.Disk.Tools.Menu"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Text.Tools.Menu]
"SubCommands"="A.Notepad;A.Wordpad"
"MUIVerb"="Text"
"Icon"="imageres.dll,-3"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Winver]
"Icon"="Winver.exe"
"MUIVerb"="Windows Version"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Winver\Command]
@="winver.exe"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Wordpad]
"MUIVerb"="Open Wordpad"
"Icon"="\"C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\A.Wordpad\Command]
@="wordpad.exe"
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 03, 2015, 10:15:27 pm
Ok... I'm learning a lot :)
This is the last .iss you must include if you want this LazPaint setup.

This "final" attached .iss has the ability to:
- Run lazpaint.exe from ShellExecuteEx (For example, you can do Windows+R key to open the Run... window and just type lazpaint.exe or just lazpaint to run it, it does not need the full path), it is done without adding to PATH, is an special registry key for doing this. So you can run command line for lazpaint from the Run... window. No need to run a cmd window!

- Also with this you can create batch files in any place with ease if lazpaint is installed

Code: [Select]
start lazpaint /New(1024,768)
Converting any file to jpg:
Code: [Select]
start lazpaint %1 %~n1.jpgFor example, drag a .png file to the batch file and it will output a .jpg file with the same name in the same directory.

Also I've fixed a spanish translation issue.

Edit:
Seems that is possible to use this command
Code: [Select]
"C:\Program Files\LazPaint\lazpaint.exe" "%1" "%l.jpg"to convert from any to jpg with right click menu with no use of batch files. The main problem is that the output file contains double extension. like myfile.png is converted to myfile.png.jpg

So, the best will be have the command directly from LazPaint.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 04, 2015, 11:47:25 pm
I understand. I wonder if that would make sense to register from LazPaint application, so that one could change the content of the menu.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 05, 2015, 08:12:20 am
I understand. I wonder if that would make sense to register from LazPaint application, so that one could change the content of the menu.

Ah OK, I see what you think.

The real way of doing this is with a COM .dll, there is something, somewhere, at embarcadero that deals with this, and is compatible with lazarus, so you can handle the menu from a pascal program... And you can manage the things that are shown from code.

But I dont have the link right now, and also I remember you need to be registered in order to download the file.

Try google "COM shell extension pascal"

Ok...

Here it is
https://github.com/RRUZ/delphi-dev-shell-tools

And this
http://cc.embarcadero.com/item/27554

____________

But, of course you can change registry with a pascal program too :) I already made something but does not include this. Check:

http://wiki.lazarus.freepascal.org/FileAssociation

Basically I tested this things with LazPaint setup first :) And also now I'm using it with some of my applications.

The main thing to take into consideration is the user privileges, in order to modify 'HKLM' you must run lazpaint as admin for example..

Or register only for the current user the settings: this is the behavior that is used, for example, by 7zip, VLC and other apps.

____________

Also I 'discovered' a way to register these commands for .png (for example) also if the .png is NOT associated with lazpaint. How it works? There is a subkey:

Software\Classes\SystemFileAssociations

There are stored a set of global menu items that has less visibility but are always displayed does not matter the program is associated with an extension.

Example:
.png always has set as desktop background, edit, print, preview and others (these are called verbs)... but these are displayed at last position where the 'vendor' verbs at top.

So with current setup I made:
.png associated with lazpaint will display "Quick edit" and "Quick effects" and then the other menus. But if I associate .png with Photo Viewer there will NOT be Quick edit and Quick effects.

This can be changed putting the verbs inside the key SystemFileAssociations\.png, so these menus will be always displayed.

For example, recently I've added:
SystemFileAssociations\.png\shell\optimize\command
"C:\optipng-0.7.5-win32\optipng.exe" "%1"

And is always displayed, at last position (I mean after lazpaint commands...) but always, not matter if associated lazpaint or wathever ;)

____________

Too much information to process, the only way to understand it is creating a separate user account (to dont break your current user registry) and start playing with the registry, or even better a virtual machine.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 05, 2015, 08:56:17 am
Well indeed I was thinking about changing the registry. I understand this thing about rights. I suppose if it is possible to register for current user, that's good enough.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: jamhitz on June 05, 2015, 11:16:32 am
I visited http://bgra-controls.sourceforge.net/ and was confronted with the Windows logo on the home page. Isn't LazPaint cross-platform?

DISCLAIMER: I have no problem with Windows, just asking?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 06, 2015, 12:06:20 am
Well indeed I was thinking about changing the registry. I understand this thing about rights. I suppose if it is possible to register for current user, that's good enough.

Yes, You can.

I visited http://bgra-controls.sourceforge.net/ and was confronted with the Windows logo on the home page. Isn't LazPaint cross-platform?

DISCLAIMER: I have no problem with Windows, just asking?

I will add lazarus logo.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 06, 2015, 06:42:25 am
Hi, with this you can remove all current registry code from the LazPaint setup and include in LazPaint application.

A good idea to use this is:
- Add -RegisterFileAssociation and -UnRegisterFileAssociation
- Run lazpaint.exe -RegisterFileAssociation [more parameters... (list of extensions to be registered, language selected)] when installing
- Run lazpaint.exe -UnRegisterFileAssociation when uninstalling

This way solves the problem of running as admin, because Inno Setup generated setup program will always run as admin!
This way solves the problem of translations, because you can add new strings to the .po files and use them when -RegisterFileAssociation is called. For example: LazPaint description and extension descriptions can be translated.

This is a working setup for registry. But you can customize it in your own way.

Any questions ask!

v2: Now with right click menu implemented.
- The only one thing left is that values are deleted only, never the keys when unregister is executed. Look at this.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 06, 2015, 12:21:45 pm
Great stuff!

I suppose that in the following code:
Code: [Select]
  { Add 'App Paths' to run lazpaint quickly from ShellExecuteEx (batch files, run window [Windows + F] and OpenDocument() at lclintf) }
  Assoc.WriteString('SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\lazpaint.exe', '', AppPath + ' "%1"');
  Assoc.WriteString('SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\lazpaint.exe', '', AppPath);
The second Assoc.WriteString cancels the first one, doesn't it?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 06, 2015, 12:28:10 pm
Great stuff!

I suppose that in the following code:
Code: [Select]
  { Add 'App Paths' to run lazpaint quickly from ShellExecuteEx (batch files, run window [Windows + F] and OpenDocument() at lclintf) }
  Assoc.WriteString('SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\lazpaint.exe', '', AppPath + ' "%1"');
  Assoc.WriteString('SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\lazpaint.exe', '', AppPath);
The second Assoc.WriteString cancels the first one, doesn't it?

Yes, just noticed it, the right code is:
Code: [Select]
  Assoc.WriteString('SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\lazpaint.exe', '', AppPath + ' "%1"');
  Assoc.WriteString('SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\lazpaint.exe', 'Path', AppPath);     


And also here the command is /Negative not /Grayscale:
Code: [Select]
    Assoc.WriteString('SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\Shell\LazPaint.negative\Command', '', AppPath + ' "%1" /Negative "%1"');
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 06, 2015, 12:52:09 pm
Ok.

We will test it when we apply it to LazPaint  8-)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 06, 2015, 12:52:31 pm
Ok seems that this never ends... fixed to really work on OS newer than Windows 7. (sorry, I just tested on Win XP and Win 7, I don't have 8, 8.1 or 10 preview).

Code: [Select]
  { 6.0 vista, 6.1 win 7, 6.2 win 8, 6.3 win 8.1, 10 win 10 }

  Win7 := False;
  if (Win32MajorVersion = dword(6)) and (Win32MinorVersion >= dword(1)) then // Win7, Win8, Win8.1
   Win7 := True;
  if (Win32MajorVersion > dword(6)) then // Newer (windows 10)
   Win7 := True;

Edit: seems that is the same as doing

Win7 := CheckWin32Version(6,1);
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 06, 2015, 02:40:07 pm
Oh I get it. It was ">=" instead of "=" for Win32MinorVersion.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 06, 2015, 09:00:46 pm
That is.

One thing left is determine why keys are not deleted (I mean the folders created at registry).

I thing that I removed that key deleting because if you don't do it carefully you can remove stuff from registry that you don't want. (Like all items in Default Programs, yeah, it happened to me.)

Inno Setup has a special way: uninsdeletekeyifempty

If I'm not wrong I removed that from here:
Code: [Select]
function TFileAssociation.DeleteValue(SubKey: string; ValueName: string): boolean;
begin
  Result := FRegistry.OpenKey(SubKey, True);
  if Result then
  begin
    FRegistry.DeleteValue(ValueName);
    FRegistry.DeleteKey(ValueName);
    FRegistry.CloseKey;
  end;
end;

We must add

Code: [Select]
FRegistry.DeleteKey(SubKey) if empty
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 27, 2015, 02:03:33 pm
Hi,

I just noticed that Inno Setup has the same functionality to handle registry from [ Code ] section. The same as using [Registry].

So you can use RegWriteStringValue and RegDeleteKeyIfEmpty and others with Pascal Script inside an Inno Setup application.

Combined with the capability of Inno Setup of adding custom forms, reading from INI files and other stuff you can create a file association tool that the user can run as administrator from your application (https://support.microsoft.com/en-us/kb/981778) that installs nothing and just is a setup of registry settings.

Another alternative at least.

BTW I still think that keep using Inno Setup is the right one, at least you will not have to deal with user premissions and elevation. You can create a custom form when the user installs LazPaint and then can choose what they want to add or not to right click menu.

But if you want it more flexible, this new option is a good one and the other is just doing it from your lazarus application.

I'm out of options :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 27, 2015, 03:23:42 pm
Thanks. Don't think too much about it though  ;)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on June 27, 2015, 07:22:53 pm
I just remember that because I was changing one of my setup scripts. I know how to use the command line :)

Also I'm making my own 'setup system', already working, is not advanced at all and not to be like inno setup (IMHO the most powerful one), just for fun. It can install and uninstall. Is interesting at least.

Because all that, I posted here.

LOL I just noticed that the forum replaced my [ code ] with the forum tag of the same name in my last post, I mean 'code section' from iss script.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on June 28, 2015, 12:39:08 am
Quote
Also I'm making my own 'setup system', already working, is not advanced at all and not to be like inno setup (IMHO the most powerful one), just for fun. It can install and uninstall. Is interesting at least.
Wow, that's great!

Quote
LOL I just noticed that the forum replaced my [ code ] with the forum tag of the same name in my last post, I mean 'code section' from iss script.
Yes, I figured it out. I suppose you can still edit your message so that it would appear as you intended.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 19, 2015, 10:10:07 pm
Hi

What about using this http://forum.lazarus.freepascal.org/index.php/topic,29104.msg183145.html#msg183145

instead of lnet? It will remove a dependency at least. It comes with FPC already :)

synapse is good too .. really I'm using synapse, but i'll try this now.

Is just for the update checker, right? And downloading translations.. Hopefully sourceforge get restored soon. With github also you have web space too, maybe works the same for this purpose.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 20, 2015, 07:48:52 pm
That's right 007. We could have one less dependency.

Indeed, the online connection is just used to check for the version and download language files. It is a simple HTTP request.

However it is in a thread. I suppose it would be possible to do the query in a thread.

Regards
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 20, 2015, 08:18:04 pm
That's right 007. We could have one less dependency.

Indeed, the online connection is just used to check for the version and download language files. It is a simple HTTP request.

However it is in a thread. I suppose it would be possible to do the query in a thread.

Regards

I know. I do the same. Without a thread the application gets frozen.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 20, 2015, 08:46:32 pm
So we have our solution. I take a note on my todo list.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 21, 2015, 12:58:51 am
Thankyou!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 21, 2015, 07:33:33 pm
Thank you for bringing this up!  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 22, 2015, 04:31:38 am
That's my job :)

How fast is your rubiks cube algorithm?
http://www.msn.com/es-ar/video/viral/campe%C3%B3n-mundial-de-cubo-de-rubik-gana-en-5695-segundos/vi-AAdhBZO
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 22, 2015, 09:51:09 pm
How wow, well when I solve it myself, I take something like 1 minute!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 23, 2015, 12:25:11 am
Nice! you are fast too!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 02, 2015, 04:40:00 am
Hi, this is the uonline.pas using fphttpclient.

It downloads the file to string and saves the lazpaint settings, but never show the new version dialog.

fphttpclient unit is not by default threaded, you must create a separate thread to make the download, and I've not included that.

Edit:

So this unit I changed is not so usefull -_- at least is usefull to know how not to do it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 02, 2015, 06:11:00 am
BTW this is the way I use to download a file with a thread using fphttpclient, maybe you already know it but I put it here ;)

Code: [Select]
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  fphttpclient;

type

  { TForm1 }

  { TDownloadFile }

  TDownloadFile = class(TThread)
  protected
    procedure Execute; override;
  end;

  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
    DownloadT: TDownloadFile;
    procedure OnTerminate(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
  Button1.Enabled := False;
  FreeAndNil(DownloadT);

  DownloadT := TDownloadFile.Create(False);
  DownloadT.OnTerminate := @OnTerminate;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin

end;

procedure TForm1.FormCreate(Sender: TObject);
begin

end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  FreeAndNil(DownloadT);
end;

procedure TForm1.OnTerminate(Sender: TObject);
begin
  if FileExistsUTF8(ExtractFilePath(ParamStr(0)) + 'File.html') then
    ShowMessage('File.html saved!');
  Button1.Enabled := True;
end;

{ TDownloadFile }

procedure TDownloadFile.Execute;
var
  TheFile: TStringList;
begin
  try
    TheFile := TStringList.Create;
    TFPHTTPClient.SimpleGet('http://lazpaint.sourceforge.net/latest.txt',
      TheFile);
    TheFile.SaveToFile('File.html');
  finally
    TheFile.Free;
  end;
end;
           
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 02, 2015, 10:49:11 am
Thanks 007!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: Sait™ on April 17, 2016, 02:17:18 pm
I have tried bgrabitmap library of lazpaint. I create Tbgrabitmap, but I can't create it with background is transparent although I create with clNone. Can u give me a suggestion, plz?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 17, 2016, 08:33:04 pm
Hello!

Just create it with Width,Height and no parameter for color.  8-)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on April 19, 2016, 10:55:57 pm
Hi, now Lazarus 1.6 has support for drawing on TToolBar and TToolButton, this can be used to theme that part of any application. LazPaint uses toolbar and tool buttons, so the idea is to provide some custom theme for that components. Is just an idea.

The main problem is that there is no single toolbar but multiple toolbars inside panels, maybe that difficults something the task or breaks the continuity of the toolbar into small ones.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.ToolBar1Paint(Sender: TObject);
  2. begin
  3.   //toolbar painting code
  4. end;
  5.  
  6. procedure TForm1.ToolBar1PaintButton(Sender: TToolButton; State: integer);
  7. begin
  8.   //button painting code
  9. end;
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 19, 2016, 11:28:23 pm
That's good to know. Thank you!  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 01, 2016, 10:42:06 pm
That's good to know. Thank you!  :)

Try this one, only is missing the drawing of the icons.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 02, 2016, 10:48:04 am
Quite nice!

It looks definitely like Photoshop.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 02, 2016, 06:11:32 pm
Quite nice!

It looks definitely like Photoshop.

Is perfectly the same as Adobe Flash (the old flash editor..). Photoshop has rounded corners and doesn't have the mouse over pressed state "MouseButtonPressedHover".
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 05, 2016, 09:26:53 pm
Hi!

Done on SVN : LazPaint does not depend on LNet anymore but use TFPHTTPClient to get updates.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 05, 2016, 10:20:41 pm
Hi!

Done on SVN : LazPaint does not depend on LNet anymore but use TFPHTTPClient to get updates.

You forget to remove project dependency on lnetvisual (project > inspector...)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 06, 2016, 12:42:12 am
I've updated the .LPI project file. Does that fix the dependency?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 06, 2016, 03:23:02 am
I've updated the .LPI project file. Does that fix the dependency?

Yes, it does.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: stuartbloom on May 06, 2016, 04:58:20 pm
Hi, and sorry if this is the wrong place, or infact a silly question.

I have two TBGRABitmap that both contain a similar image (taken from a webcam) that have been masked such that only a certain part of the image remains.

Is there any way to compare these images using lazpaint or will I have to go through both images pixel by pixel. 

Thanks in advance

Stuart
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 06, 2016, 05:31:27 pm
I think there is no function to do that, but you can access pixels this way:

Code: Pascal  [Select][+][-]
  1. // all pixels //
  2. var
  3.   i: integer;
  4.   p: PBGRAPixel;
  5. begin
  6.   p := Bitmap.Data;
  7.  
  8.   for i := Bitmap.NBPixels-1 downto 0 do
  9.   begin
  10.     p^.red := ;
  11.     p^.green := ;
  12.     p^.blue := ;
  13.     p^.alpha := ;
  14.     Inc(p);
  15.   end;

Code: Pascal  [Select][+][-]
  1. // scan line //
  2. var
  3.   x, y: integer;
  4.   p: PBGRAPixel;
  5. begin
  6.   for y := 0 to Bitmap.Height - 1 do
  7.   begin
  8.     p := Bitmap.Scanline[y];
  9.     for x := 0 to Bitmap.Width - 1 do
  10.     begin
  11.       p^.red := ;
  12.       p^.green := ;
  13.       p^.blue := ;
  14.       p^.alpha := ;
  15.       Inc(p);
  16.     end;
  17.   end;
  18.   Bitmap.InvalidateBitmap;
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 06, 2016, 11:21:02 pm
I would say it is better to go through all pixels and use the comparison function you want. For example you may use ColorDiff and check if the difference is less than something, to allow for a small variation.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 09, 2016, 05:40:41 pm
You know that LazPaint, BGRABitmap Tutorial and BGRA Controls (the old Dibo topic) are at the top of views and replies in this forum?

http://forum.lazarus.freepascal.org/index.php?action=stats
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 09, 2016, 07:55:27 pm
I noticed that there were many views for BGRABitmap. But seeing the statistics it is quite impressive. However many messages are from me as I post regularly when there is a new version of the software.

Looking at the stats, I discovered Android Module Wizard. Seems quite cool!
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 17, 2016, 09:11:47 pm
I've uploaded the deb package for amd64 tested in Ubuntu 64:
https://github.com/bgrabitmap/lazpaint/releases/tag/v6.4.1

Is the first deb package I made ever, with this tutorial:
https://ubuntuforums.org/showthread.php?t=910717

I finally can compile that LazPaint version  8)

I'm not sure if using x86_64 in architecture part instead of amd64 will work the same, any ideas?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 04, 2019, 09:15:05 pm
Hello people,

I know it's been a long time but... a new beta version of LazPaint is ready (version 7.0.1).
https://github.com/bgrabitmap/lazpaint/releases

Binaries not generated yet. Though you can compile it using latest version BGRABitmap 10.2 and of BGRAControls.

There are some issues with the translation files:
https://forum.lazarus.freepascal.org/index.php/topic,45980.0.html

Here is a list of changes.

FILE FORMAT

New support
- ICO/CUR format: it is possible to select a size and also to add/remove an icon size
- GIF format: it is possible to select a frame and also to add/remove frames
- SVG format: loaded as a vectorial layer that can be transformed
- TIFF format: images in L*a*b* can be loaded
- LRS and RES multi-file containers: create, load and save into them

There is new button in the toolbar to choose the image entry (icon size or GIF frame).

Misc
- there are options to remember last save directory and format after closing the app.
- better choice of color depth when saving

DRAWING TOOLS

For now shapes cannot be edited after validation. They are still rasterized.

Improvements of the following tools to allow rotation and transform:
- rectangle
- ellipse
- gradient: can shear the diamond and radial gradients
- phong shape
- text: layout box, paragraph alignment, blur radius in tenth of pixels, better support for Unicode
- selection rectangle
- selection ellipse

Misc:
- finer zoom when holding CTRL key.
- ratio can be specified for selection rectangle/ellipse

LAYERS

New tool: zoom layer.

At the layer level, it is now possible to move, rotate and zoom a layer without rasterizing it. This is true for raster layers and also for SVG layers.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 05, 2019, 01:45:12 am
Hi, thanks for the new version. I've added binaries for Win32, Win64 (installer and zip file), and as well macOS 64 (bundle in a zip file, including icon and translations).
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 05, 2019, 02:49:07 am
Thanks  :)

I will try doing the deb files for Linux.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 05, 2019, 01:35:48 pm
I've added binaries for Linux 64 bit.  :)

Though I am have trouble with cross compiling to Linux 32 bit. When adding a release mode for Linux 32 it says that "/usr/bin/fpc" doesn't support the target i386-linux.

If I try to compile anyway it says:
Error: ppc386 can't be executed, error message: Failed to execute "ppc386", error code: 127

I found a wiki page that apparently explains how to do. I applied that but that doesn't solve the problem.
https://wiki.lazarus.freepascal.org/Cross_compiling#From_Linux_x64_to_Linux_i386
 :'(
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 05, 2019, 05:48:20 pm
Try with fpcupdeluxe. You can install a separate Lazarus and add cross compilers even for release   version of FPC and lazarus.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on July 27, 2019, 10:42:13 pm
New TEST version of LazPaint 7.0.2
https://github.com/bgrabitmap/lazpaint/releases

Hopefully this version is stable. Please tell me if you find a bug.

Linux 32 and 64 binaries provided

Various fixes:
- bug with selection tool, undo and others
- drawing successive shapes
- scroll bug on Windows
- fixes for future version compatibility

Improvements:
- layer stack: scrolled with mouse wheel, hint on layer kind icon, tool button to rasterize layer
- show layer bounds when transforming it
- better handling of zoomed out layer
- text tool: word wrap does not change with zoom, arabic ligatures and for other scripts, support for unicode non-spacing marks (like added accents/tilde)
- polyline/curve tool: now rendered as vectorial
- faster rendering of shapes in draft mode (while editing)
- switch between fill shape and draw shape mode with one click on selected tool button
- better drive detection on Linux
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 28, 2019, 12:37:49 am
Thanks for this.

I've added Windows and macOS binaries.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on July 28, 2019, 12:41:48 am
I've drawn this with LazPaint, with Layers, filters, renders, a lot of tools used.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on August 02, 2019, 04:20:55 am
I tried make a circle, in a 1:1 page with 1:1 size, centered, but then I found make this simple thing is a bit complicated indeed. Or maybe it's my inexperience :P

But well, In any case I think can be useful something to "align here or there right, left, center, middle, top, bottom " selections and forms, you know as almost svg edit tools, but with raster graphics too :)

and also, since we have now an new info bar, why not make this more useful allowing input custom values ​​for position and sizes?

All this to make my circle more circular hahaha, but ok this will be more useful for any kind of thing of course.

(https://i.ibb.co/0CHRd7B/editor-method-ca.png)

Another thing, we have Ratio option for selection tools but no in the shapes, yeah, I've noticed this while I tried make my circle ;P
so, I think we need the Ratio option in the shapes Rectangle and Circle too.
At least I find this a bit strange, view in selections but not in the shapes, since are relative tool.

---
I guess is possible make the "perfect circle" with the current tools, I think is good know how to make the things in the "hard way", learn how make things by own hand.
By example I know we can center any thing with just cut and paster as new layer.
But I  would like know how make the circle then, can someone give me a quick "how to" just for fun :P
How to make an circle centered which cover all the size of page.

I want recreate something like this
(https://i.ibb.co/bm9YbhP/DD.png)
But the circle elements was the hard part for me heh.
Will be interesting how make the gradient, although I guess looks simple and can be made better :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on August 02, 2019, 04:23:17 am
I've drawn this with LazPaint, with Layers, filters, renders, a lot of tools used.
btw nice draw!  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 02, 2019, 03:59:50 pm
Thanks for the feedback carlos. I take a note the the alignment feature.

About the ratio for other shapes, I thought your request was only for selections and also my worry was about taking up to much space in the toolbar. It already takes the whole width of the screen.

Note that you can make a perfect square or circle by holding the SHIFT key while drawing it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on August 03, 2019, 08:51:53 pm
hey hey, I'm back with more  >:D
I'm not sure how to reproduce this bug ?
But check this file with lazpaint 7.0.2 (made in this version of course)
https://drive.google.com/file/d/1UZNZ-IFe1jAhJwh6BNAjjo4M9BtSN3lh/view?usp=sharing
then resize to any size (even just one more pixel or one less pixel!)
---
I've notice I can make the circle with just make an 1:1 selection and then fill this, later I can copy this and paste as new to have centered :)

The holding SHIFT option is good, but don't makes an 1:1 circle/square, this just resize without change the current aspect, what is good, I comment this just to remember and to it and in case it can be useful for someone later.
---
btw circular, can you give me the vector edit program for linux no install 32 bits, please. I don't know where find this :P
and for windows too, I can use this later there also
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 03, 2019, 10:00:09 pm
In fact you can create a perfect circle holding shift when first creating it.

And I canm confirm the resample problem, it moves the layers strangely.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 03, 2019, 11:52:53 pm
Thanks Carlos, indeed there is a bug with resample when layers have different sizes. Gonna fix it. EDIT: done on dev branch of bgrabitmap.

Well vectoredit is somewhat experimental, but I am thinking about doing a usable version.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on August 05, 2019, 09:24:13 pm
Heh today with the "Magic wand select" tool selecting an filled circle the selection was made but in an wrong location, more at top left while the circle was located in the center, a bit weird, I guess probably by same bug.
---
Well, I want really view Lazpaint allowing make vector and raster graphics at same time, but vectoredit as an complementary/optional tool can be ok.
---
Quote from: circular
About the ratio for other shapes, I thought your request was only for selections and also my worry was about taking up to much space in the toolbar. It already takes the whole width of the screen.
btw yes, the tool options in the toolbar it's a bit messy, don't you think?
ie at first it was a simple and quick way, but with each new feature/option is occupying more and more space making it a mess, specially because also the option location changes according with the size of the window itself.

I think lazpaint tool options (maybe the workspace in general?) need some redesign, something as a tool options sidebar.
Some references from other programs:

Chasys Draw IES I don't like much this workspace, although is ok :P
(https://www.jpchacha.com/chasysdraw/shots/chasys_draw_ies_swm.png)

gimp 2.8 with photosho tweaks? I think looks good indeed.
(http://orig15.deviantart.net/06b2/f/2014/044/f/8/gimp_2_8_photoshop_tweaks_by_doctormo-d75n1qc.png)

Paint.net hah! It's like Lazpaint?
(https://image.jimcdn.com/app/cms/image/transf/dimension=589x10000:format=jpg/path/sa5512209e9247ee5/image/i0b8c20340f93d43b/version/1549735380/image.jpg)

I know and understand that they are focused on the development of bgrabitmap, but never it's too late to comment on these things heh.

I'm sorry if I asking so much, but  I want request and comment more things.

If possible I want a option to disable the antialiasing in texts.
Why that? Because I remember I was changing text a game, a game with Game Boy style, so all text here is pixelated, without antialiasing :P

About the Text tool, is nice how we can make text inverted in any direction, but and text deformations?
Probably adding more for the options to make things like this:
(https://i.ibb.co/RcD5FWM/pictfont-text-deformations.png)

Another detail, the text box I think It should readjust automatically when typing.
Is really strange write and don't see anything, I know we can draw the text box but At least for me is better if it does this automatically.

And well, I think is all, at least for now.. ;P

Kind regads.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 06, 2019, 10:52:46 am
Hi Carlos.

THanks for the feedback. I fixed the offset of the magic wand on dev.

About vectoredit, it does not really make sense to publish it as I am close to publishing a vector version of LazPaint.

About the workspace, indeed there are some possibilites to think about. I find that Gimp idea to put tool options above the layer stack to be ok.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on August 13, 2019, 12:30:40 am
Hi hi circular! I'm back with more comments.

1. The thumbnails in the layers window:
Why not make as squares instead that instead of that parallelograms?
That zoom in / zoom out buttons they're just to make that miniatures bigger or smaller, making the interface a little disastrous.

My idea is: make the thumbnails as squares and show only the area seen in the edition, if we have zoom in the area, then you show a small rectangle in the thumbnails that allows us to move with this.

by example from JPEGView (a image viewer for Windows)
https://a.fsdn.com/con/app/proj/jpegview/screenshots/275965.jpg/

idea example
https://i.ibb.co/f9CXKdd/lazpaint-layers001.jpg

2. The "Paste as new layer"
many times I need to paste part of an image in another place, zooming as usual to have the place focused, when pasting as a new layer, it sticks to the center of the canvas, forcing me to see the whole canvas again and move it to the desired place.

"Paste as new layer" just like "Paste" must paste the new layer in the center of the view.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 13, 2019, 09:33:45 pm
Hi carlos

1. Not sure where you're going with this. From the screenshot, I infer you are suggesting that one could select the visible area from the layer stack?

2. I get your point. Note that you can add a new empty layer and paste the selection there.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on August 14, 2019, 12:01:06 am
Quote from: circular
1. Not sure where you're going with this. From the screenshot, I infer you are suggesting that one could select the visible area from the layer stack?
Yup, although perhaps having a thumbnail as minimap in all layers will overload the interface?
Maybe add a new "navigation window" with which to scroll.
Can be useful in big images and different cases.

Photoshop https://i.ytimg.com/vi/3QVkR3HRKU4/maxresdefault.jpg
Gimp https://www.swotster.com/swotster/English/GIMP/images/images_les_009/les09_image003_en.jpg

Quote from: circular
2. I get your point. Note that you can add a new empty layer and paste the selection there.
Heh I see, anyway I think is better if the new layer is pasted in the center of the view and not the canvas, if we want put in the canvas center just make the full view :P

Oh btw I hadn't noticed but you have fixed when the layers come out of the canvas they are no longer lost.
Thanks!  :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 17, 2019, 01:17:14 pm
New version of LazPaint 7.0.3
Hopefully a stable version
https://github.com/bgrabitmap/lazpaint/releases

Linux binaries provided

Tools
    edit shape tool
    copy/paste shape
    align shape horizontally/vertically
    bring shape to front/send to back
    shape count limit
    rotation lock on 90 degrees unless Shift is pressed
    add wave displacement filter
    add aliased mode for eraser

Interface
    selection pen shortcut changed to "O" letter key
    fix update on move image
    minor toolbar adjustments
    less space used by upper toolbar, nicer comboboxes
    faster draft gradient rendering
    dark theme option
    fix undo/redo with originals

Optimize
    optimize selection rendering
    less memory usage by selection
    update highlight when rotating
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on August 18, 2019, 10:01:21 pm
Thanks for this f*cking great new version circular! :D

Here my observations.
1. I think the options to move shapes can be sorted better, current sort is a bit confusing:

<  move up
|< bring to front
>  move down
>| send to back

can be something as:

|< bring to front
<  move up
>  move down
>| send to back

or

<  move up
>  move down
|< bring to front
>| send to back

---

2. Thank you so much by the Edit shape tool, realy cool :D
But while we can edit all point from Polygon/Polyline and Spline shapes, we can't make the same with the points from Polygon and Curve from selections.
I guess since the selection are saved as flat images without coordinates, etc :P
---

3. Haha thank you so much by add the percent in the transparency indicator of layers :D
Each samll detail makes Lazpaint so much better and cool ^.^
So talking about small details, make usable the mouse wheel usable in the percent indicator and in the blend operation list from layers window.
---

4. Thanks by the dark theme also :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 18, 2019, 11:01:44 pm
New version 7.0.4 with minor changes:
    adjusting font size for windows
    fix screen update
    duplicate vector original when duplicating layer

https://github.com/bgrabitmap/lazpaint/releases

@c-sanchez:
1. I see your point
2. Yeah for now selection is not vectorial. That may come in a next release though
3. Mouse wheel on the blend mode is interesting. For the opacity, I prefer not, it might be a bit confusing
4. Dark theme is a great idea of Lainz
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 19, 2019, 12:30:23 am
Is really cool to edit the vector shapes. A thing I'm missing is the hability to insert new points between to points when editing, also removing existing points. Maybe also merging two points (to simplify the path but keeping the shape like the original as possible) as well, but this one is optional.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: winni on August 19, 2019, 12:51:00 am
I support Laint point of view. And what is allways missing in vector programs: the ability to insert more than 1 point between two others. That would be helpfull to stop this "click an mark and click ...".

And a very nice feature for simplifying vector graphics would be too reduce the points of a whole area or all the selected points. This is often needed when a v-graphic is the output of a trace program. The Douglas-Peuker-algorithm is very helpfull for that.

Winni
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 19, 2019, 01:09:30 am
I'm currently drawing with LazPaint and ideas comes:

- When finish the drawing a shape with the spline tool and press enter key, keep it selected, I usually then go to the edit tool and do adjustments. (This is to save a few clicks nothing more).

- An option to display vectors in his max resolution, not pixelating them. Of course off by default so the program runs faster, but it will be nice to have that option.

- An option to export the drawing at any resolution, if it has vectors scale them proportionally. If it has bitmaps scale them with a resample filter.

- An option to start a drawing with spline always with 'Close shape' disabled. I use that plus 'inside' mode to follow the curves of any shape. I prefer that mode of drawing than easy bezier. And I use 'close shape' to follow it better, since if I close the shape is hard to see where I'm drawing, plus I set the fill to some semi transparent color. Else I need to switch to 'close shape' every time, since when I finish the drawing I finally close the shape. (This is to save a few clicks nothing more).

Edit: a work in progress image attached, I get the image from pinterest and start converting it to vector in LazPaint, the original image is from an embroidery work.

Edit 2: when the zoom is at the maximum I can't grab the nodes and move them.

Add Convert a circle / rectangle to an editable spline. Sometimes we want a non perfect circle and rectangle or add more nodes to them.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 19, 2019, 10:18:41 am
Hi

In fact it is possible to add points between existing points using the Insert key, and to remove a poitn with the Delete key. You need of course to put the mouse where you want to insert/delete the point.

Though from reading winni I have the impression it is another thing, like inserting a series of point. Would it be like splitting a segment in equal parts?

I take a note for simplifying path and displaying at high resolution though that's not a priority in my view for the following reason:
- path is entered point by point by the user, so the user could simplify at that moment (if I understand correctly?)
- high resolution would be a whole new rendering system, so I prefer to delay that until current version is stable

What can be done quickly:
- exporting to any resolution: relatively easy to do. It is basically doing a resampling and exporting the file.
- adding a series of point between two points (if I understood correctly?)

What can be done reasonably:
- converting a circle/rectangle/polygon to editable spline
- have an opened shape by default. what I am thinking is the suggestion of Carlos to reduce the interface size by having just one icon for shapes, and when hovering having a more thorough list. The new items I am thinking of is to draw a polyline and draw an opened curve without filling. Of course the user can then choose to close/fill the new shape.

I am not sure I understand the thing about clicking points at high zoom.

About going to edit tool when doing a spline, you can press the J key instead of the enter key to go directly to edit tool.

By the way, nice drawing  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on August 19, 2019, 02:31:14 pm
I've added "Edit > Convert shape to curve" on dev branch, I think there is no risk with adding that now.

For now, I prefer not to do the other change because I would like this version to be tested so that it can be released officially.

So please try and make it crash my friends.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 19, 2019, 03:50:39 pm
Thanks I just wanted to add a single point. Pressing J does the trick so for me is easier to work now.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: winni on August 19, 2019, 10:56:17 pm
Hi!

@circular

Quote
Though from reading winni I have the impression it is another thing, like inserting a series of point. Would it be like splitting a segment in equal parts?

Yes, you got me.

Example: You have to create a mask or a contour a of a part of a bitmap. You set the first two points. And at this point, it is nice to have a couple of points on the canvas and not to go after every point to the UI. 

Winni
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 24, 2019, 09:05:23 pm
Image made with newest LazPaint attached.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: RAW on August 24, 2019, 10:37:11 pm
Quote
Image made with newest LazPaint attached.
Interesting ... very nice.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: nouzi on August 24, 2019, 11:00:46 pm
@lainz
you can add name the application to metadata  ?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on August 25, 2019, 12:35:09 am
Quote
Image made with newest LazPaint attached.
Interesting ... very nice.  :)
Thanks =)

@lainz
you can add name the application to metadata  ?

How I can do that with an external application?

Or you mean that LazPaint add the metadata? circular can do that I think, he is the author of lazpaint, I only help testing and finding bugs.

This is a png file it can have metadata as well?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: nouzi on August 25, 2019, 02:36:53 am
The marking  or tag in the metadata shows the name of the application used
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lucamar on August 25, 2019, 05:07:29 am
This is a png file it can have metadata as well?

Yes, the PNG format have a quite complete set of metadata-related groups. It's not as standardized as, say, JPEGs (just "informal" standards) but with the proper application you can add Exif, IPTC, XMP and most any other kind of metadata to them.

ExifTool (and ExifToolGUI) is one of those applications, written IIRC in Perl.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fred on August 25, 2019, 10:23:53 am
The Metadata in PNG files
https://dev.exiv2.org/projects/exiv2/wiki/The_Metadata_in_PNG_files
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: nouzi on August 25, 2019, 10:52:01 am
@Fred  8) @ lucamar  8)

@lainz
Exactly this line
Software   Software used to create the image
Software = lazpaint
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on August 29, 2019, 03:23:03 am
A picture of my cat taken by my sister long ago, made as a drawing with Lazpaint.
Just for fun, a little practice and to know how is working lazpaint now.

Is not perfect but I think to be a "quick drawing" is cool the result :)
Maybe the eyes can be improved a bit, I'm not sure how make the mouth, the fur in the neck.. meh that's ok ;P
I think will be interesting make this same but as vector later hehe
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 05, 2019, 09:44:30 pm
Nice drawing.  :)

Vector version is coming soon. It seems that all bugs are fixed. Now we are making the binaries.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 06, 2019, 12:12:46 pm
New version of LazPaint 7.0.5 (seems stable)
https://github.com/bgrabitmap/lazpaint/releases

This is an official release  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: nouzi on September 06, 2019, 12:48:31 pm
Nice working
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 07, 2019, 09:15:49 pm
Thanx  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: jeffrey1820 on October 05, 2019, 01:21:33 am
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...
Code: [Select]
    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...
Code: [Select]
    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.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on October 05, 2019, 01:56:15 am
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...
Code: [Select]
    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...
Code: [Select]
    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.

Reported in GitHub
https://github.com/bgrabitmap/lazpaint/issues/56
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on October 14, 2019, 04:00:09 pm
New version of LazPaint 7.0.7. This is a recommended update from 7.0.6 as it contains a significant amount of bug fixes.
https://github.com/bgrabitmap/lazpaint/releases

Bug fixes
fix crop layer with offsets/small layers
fix bug with duplicating vectorial layer
fix undo of merging duplicate layers
avoid bugs with vector layers in certain cases
fix layer visibility update
update inactive layers with undo/redo
fix bugs when actions or tools interact
fixed opacity bar when layer stack is zoomed
update screen when changing workspace color
fix shift colors shortcut

General
show context menu when right-clicking upper toolbar unused space
faster saving of LZP files
handles external changes in multiimage files (TIFF, GIF, ICO) more gracefully
entry to duplicate current frame of GIF or TIFF
merge vector layers with vector layers
merge vector layers with other layers by transforming them into a rectangular shape
in color window, triangle cursors are clickable

Edit shape tool
update toolbar when selecting shape
space key allowed when editing existing text shape
transform background fill of rectangular shapes (in particular after merging raster and vector layers)
right click to rotate/shear a rectangular shape
avoid shape distortion when copying between layers with different transform
allow to clear/copy the whole layer if it is a gradient or a rotate image with Delete or Ctrl-C
more permissive selection of shape (one can click a few pixels away)

Polygon tool
holding SHIFT (along with Insert or I key) inserts new point on the segment
close shape when clicking first point (when polygon or curve is open)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on November 02, 2019, 01:31:13 am
Download and try to open this image in LazPaint
https://github.com/crystal-bit/triple-triad-godot/blob/master/GameScenes/Battle/Textures/field.png
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 02, 2019, 01:42:48 am
Download and try to open this image in LazPaint
https://github.com/crystal-bit/triple-triad-godot/blob/master/GameScenes/Battle/Textures/field.png

If I open it with mspaint and then save it as PNG, then open it with lazpaint works.

The file size differs BTW:
original file 2335kb
saved with mspaint 2573kb
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: winni on November 02, 2019, 01:47:43 am
Hi!

Lazpaint moans: "CRC check faild"

Gimp opens it with no issues.

Winni
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on November 02, 2019, 05:39:29 am
Quote from: winni
Hi!

Lazpaint moans: "CRC check faild"

Gimp opens it with no issues.

Quote from: lainz
If I open it with mspaint and then save it as PNG, then open it with lazpaint works.

The file size differs BTW:
original file 2335kb
saved with mspaint 2573kb

Yup, I have the same trouble, I think it will be interesting know what is the reason that fails on LazPaint.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 02, 2019, 11:00:27 am
Hi folks,

So the reason is that there is a chunk that has an invalid CRC. Though in this case, it is an ancillary chunk (= non essential). Thus it can be ignored.

On dev branch of BGRABitmap, I've updated the reader to simply skip in this case. It makes no difference in the image in this case.

Regards
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: winni on November 02, 2019, 01:26:06 pm
@ c-sanchez

So Photoshop delivers corrupt png files?

Am I right?

Winni
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: winni on November 03, 2019, 12:34:11 am
If there is no reply  then I am on my own:

Code: Bash  [Select][+][-]
  1. strings field.png | grep Photoshop
  2.  
result:

Code: Bash  [Select][+][-]
  1. Photoshop ICC profile

So: Yes, Photoshop delivers corrupt png files.

Winni

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 03, 2019, 02:30:01 am
how is the status of the lazpaint scripting with python?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 03, 2019, 06:42:02 pm
Code: Bash  [Select][+][-]
  1. strings field.png | grep Photoshop
  2.  
result:

Code: Bash  [Select][+][-]
  1. Photoshop ICC profile

So: Yes, Photoshop delivers corrupt png files.
Hmm, and precisely that's the chunk for ICC profile that has bad CRC.

how is the status of the lazpaint scripting with python?
It's going well. I am 80% done I guess.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: winni on November 03, 2019, 07:22:05 pm
@circular

Be prepared on a lot of trash inside the image files - sometimes with funny results.

A TIFF file can contain more tham one image - the most apps only recognize only the first one.
In TIFF images you can save CMYK colors - they are mostly not respected and interpreted as RGBA - funny looking.

A lot of PostScript-/EPS import modules dont look for the XY-origin and think it is topleft. In Postscript you can set every corner as orign. Ther result are mirrored or upside down displays.

And so on ....
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 03, 2019, 08:07:32 pm
Yep, I took care of all those cases in the TIFF reader. CMYK and Lab pixel formats and rotating/mirroring the image.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 03, 2019, 08:47:13 pm
It's going well. I am 80% done I guess.

Cool =)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 03, 2019, 11:44:00 pm
For the basic feature of the scripts, what remains to do is:
- commands of the Edit menu
- tool attributes (pen etc.)

Then maybe some advanced features like:
- vector commands
- storing information in the LazPaint file (for example a script could store what options the user used)

I am wondering about interface, but I think one can do one with Python.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on November 17, 2019, 12:10:59 am
Ok, for some time I want to comment all the things I would like to see and I wondering if they will be avaiable in later in Lazpaint, so I will try list all my wishes/ideas/comments here

1. Index Color support, edit color index palette, convert image to full or indexed color, and anything related
since i knew about the existence of the color index i feel that a raster editor without this is incomplete :P

https://i.ibb.co/Fx3FxDq/indexcolor.gif

2. Docking. You know, I think I've commented these things many times, but is a point too.
That colors and layers docking is fun and ugly to watch.
Comparing interface workspace with similar window size
Lazpaint https://i.ibb.co/wpCvnvj/lazpaint.png

lazpaint docked https://i.ibb.co/bBzCLkK/docks.gif

phoxo https://i.ibb.co/1m6gg3k/phoxo.png

pictbear https://i.ibb.co/tM8byr9/pictbear.png

3. Following regarding the interface, the toolbox docked is good indeed, at least I think looks so
but, I commented on it some time ago (years ago?) in sourceforge and I saw you recently added this in github heh.
Group the toolbox by category, we can see is in some editors.
By example I saw this recently in Photo Pos Pro 3
https://i.ibb.co/yk4WFQ0/sshot-002.png
https://i.ibb.co/7YNwJyy/sshot-003.png
However I find it unpleasant the interface of Photo Pos Pro 3 :P

Lazpaint toolbox docked
https://i.ibb.co/R96WSmc/toolbox.png

My "mock up"(?) idea to lazpaint
https://i.ibb.co/vHx9z16/toolbox-group.png

4. As I was writing this message and seeing Phoxo and Picbear, I remembered this point.
Multiple-Document Interface
Open different images/Projects/ ..Tabs? in Lazpaint

5. Extra image formats support.
For some time now I think it would be nice to see some extra formats like WebP, BPG (https://bellard.org/bpg/) and FLIF (https://flif.info/).
If I'm right, Lainz is working in webp, right? :)

and well, I think that is all.. for now... :P
I'd like to know what you have in mind about all these points circular  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 17, 2019, 11:37:11 am
I think LazPaint is already good  :)

Also made 99.9% by only one person.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: fred on November 17, 2019, 12:15:48 pm
LazPaint checks for update on startup, can it be made to disable this?
I know, i'm from the time that we only connected to internet when we needed to :)
And yes, I don't have a smartphone because I don't want to be connected all the time  8)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on November 17, 2019, 03:41:35 pm
I think LazPaint is already good  :)

Also made 99.9% by only one person.
Yeah, LazPaint is really cool.
Its interface, one of the points that I most criticize, I find it very comfortable indeed, but at the same time I feel that it can be better.
btw, I wonder how the hell it'll keep the interface nice by mixing raster and vectors, but it's probably going to be a cool thing too :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 17, 2019, 04:00:56 pm
Yeah, LazPaint is really cool.
Its interface, one of the points that I most criticize, I find it very comfortable indeed, but at the same time I feel that it can be better.
btw, I wonder how the hell it'll keep the interface nice by mixing raster and vectors, but it's probably going to be a cool thing too :)

Well it already support vectors and is working fine, check this picture
https://www.facebook.com/LazPaint/posts/2540567102647681

Is a full vector image made with LazPaint.

The thing is that by now it does not draw the vectors in "more quality" when zooming, but is a vector, you can see if you do an image resample.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: winni on November 17, 2019, 04:46:18 pm
Hi!

In CorelDraw you got different logical modes of viewing your drawings:

* wireframe : just show the vectors in b/w. Good for searching a "lost object" like a transparent vector on a transparent background .....And for a quick overview.
* preview: low quality but quick showing the colors and gradients in "80s graphicmode"
* high quality: showing everything as it is, but it might take a while with a lot of vector objects, filled with gradients or filltered elements.

Perhaps this is an idea for LazPaint.

Winni
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 18, 2019, 03:22:48 am
In CorelDraw I always use the high quality view, but I mostly do artistic drawings so nothing that needs pixel perfect to use the outline view  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 18, 2019, 12:37:47 pm
Hi folks,

Thanks for your input. I need to think about all your suggestions. Note that if you consider one thing is not in the list of issues on GitHub, and that it may be implemented, then I invite you to add it.

Some update about Python script, the tkinter module works well and this way a script can show a window of its own and interact with LazPaint at the same time.

About pixel resolution, it is somewhat limited in LazPaint. It might be accelerated though by decomposing bitmaps into grid of bitmaps. This would require more memory.

@winni: The wireframe mode is indeed interesting.

@c-sanchez: I see some new suggestions. Regarding webp, it's already working on dev branch.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on November 18, 2019, 05:35:36 pm
I've added new python scripts for making a 3d room (where you can paint next), and fractal trees
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on November 19, 2019, 01:40:23 pm
Very nice.

I am adding tool styles to the scripting language. That's kind of cumbersome so takes more time that I thought. But am getting there.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on January 25, 2020, 05:13:35 pm
Before starting a thread on github, I guess is better first post here in the forum and see what they think :)

What you think about "guide lines + snap", this is a feature in GravitDesigner, check how works, I think is pretty cool :)
https://i.ibb.co/mFjQd1v/snap-guidelines.gif
Is really usefull to align shapes/layers quickly
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on January 25, 2020, 07:28:54 pm
I reckon it's cool. Yep that can be one ticket on GitHub  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on February 17, 2020, 05:34:21 pm
the selection tool is not accurate to select pixels, so if we want to select for example, parts of a sprite, we'll have to do two things
1. select the desired pixels
2. deselect unwanted pixels, that are added by the way the selection tool treats the corners of selected pixels.
Smoothed?

https://i.ibb.co/GnV7nyj/x-lazpaint-selection.gif
In this gif I finish selecting only the left part of the sprite.
while the right side that's already selected, I also did the second step before, deselect the pixels of the corners.
Then when pasting the image we can see how the curves create partial selections.

I guess that "smoothed" kind of selection can be nice in certain cases, but in other as this is a bit uncomfortable.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 18, 2020, 12:54:22 am
Yep. If the width of the pen is one, using CTRL will align to pixels and you get full pixels selection.

I will add the aliasing option in next version for you.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on February 18, 2020, 03:13:13 am
Even with ctrl the aliasing is there, but yes with the option to disable must be enough :)
btw, please add disable aliasing option for shape tools too.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 18, 2020, 04:31:17 am
I suppose you mean that even with ctrl the antialiasing is here.

I've added your request:
https://github.com/bgrabitmap/lazpaint/issues/111
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on February 19, 2020, 04:31:56 am
Ah yeah, is antialiasing haha :P
thanks by add the request :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on February 19, 2020, 06:16:35 am
Is harder in Spanish because one thinks is anti alisado when in fact is anti afilado.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 19, 2020, 10:00:57 am
I see.

I wonder about the etymology of this.

On Wikipedia, it is written that aliasing comes from alias that means "differently" and so that aliasing means getting something different from what was expected.

So I presume it is that when trying to draw a line, you get unwanted steps, which are unexpected and gives a different appearance that what was intended.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on February 19, 2020, 01:30:28 pm
Well maye I was wrong, I found now that in Spanish is 'antiplegamiento' that has less sense to me. But the reason of my confusion was that when I was younger I see that word 'antiafilado' in a nvidia videocard box  :-[ I presume wrong translation or there was no other translation in that time. Please check if in lazpaint is correctly translated into 'antiplegamiento' or better use anti-aliasing that's widely known.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 19, 2020, 02:14:03 pm
Hmm ok.

I found another translation: antisolapamiento. Does it sound better?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lucamar on February 19, 2020, 02:21:24 pm
Well maye I was wrong, I found now that in Spanish is 'antiplegamiento' that has less sense to me. But the reason of my confusion was that when I was younger I see that word 'antiafilado' in a nvidia videocard box  :-[ I presume wrong translation or there was no other translation in that time. Please check if in lazpaint is correctly translated into 'antiplegamiento' or better use anti-aliasing that's widely known.

You were right the first time: the more correct translation (in this context) to Spanish is "anti afilado"*, but it's mostly left untranslated nowadays, as so many other computer terms.

The problem is that too literal translations to Spanish often result in strange or "funny" terms being used; for example, "buffer" is often translated to "tampón" but the more common uses of that word are for a kind of feminine higiene product or for an inkpad ...

And frankly, "anti-plegamiento" sounds more like a geological process ;)


* Of course that leaves us either without a word for "sharpening" or with a context-dependent translation. But we don't worry much about it: it happens quite often which is why "latin" languages are so rich for jokes and riddles. :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: garlar27 on February 19, 2020, 05:54:02 pm
GIMP use "Afilar".
It's been ages since the last time I applied filters to something that I can't recognize the spanish's filter names  :o
ETA: though I don't know if afilar is the antialiasing or if it is sharpening
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 19, 2020, 06:27:54 pm
@garlar: no estoy seguro de que este "afilar" es a propocito de antialiasing.

Cuando se trace una ruta, es escrito anti-alias:
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lucamar on February 19, 2020, 07:08:07 pm
ETA: though I don't know if afilar is the antialiasing or if it is sharpening

Context is everything :) In this case, of course, it refers to "sharpen": note that it mentions specifically the "unsharp mask" filter.

In your image "anti-aliasing" is translated as "Alisado", which must be new: older versions used "antialias" there.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on February 19, 2020, 07:24:49 pm
I hadn't noticed that "anti-aliasing" was translated, yes, that "antisolapamiento" sounds weird.

Indeed my confussion was because:
"aliasing" sounds for me as "alisado" synonymous of "suavizado" (smoothed)
then, anti-aliasing sounds like "anti-smoothing", when really "anti-aliasing" is that "smothing" right?
while the "aliasing" is the image "pixelated"

The "problem" here is that "anti" haha, maybe if be default the tools are "aliased" is better, as with paint ;P
I have also a doubt with this, you are addding the "alising", when indeed this is "natural" (pixelated) no?
So for me have more sense make default the aliased.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on February 19, 2020, 09:14:04 pm
Anti-alias: Alisado, I prefer that one (like used in the GIMP screenshots), that translation has sense, and we remove the "anti" problem of negating 'Afilado' or 'Pixelado'.

Afilado: is like it has noticeable borders, like a pencil point, a sharp knife, etc. So the meaning is correct for this case.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 19, 2020, 11:12:08 pm
So for me have more sense make default the aliased.
Nope. Most people wants nice graphics. It is only if you know what you are doing that you would want to have aliasing.

Anti-alias: Alisado, I prefer that one (like used in the GIMP screenshots), that translation has sense, and we remove the "anti" problem of negating 'Afilado' or 'Pixelado'.

Afilado: is like it has noticeable borders, like a pencil point, a sharp knife, etc. So the meaning is correct for this case.
Ok, sounds good to me.

So antialiased = alisado and antialiasing = alisamiento
And aliased = afilado
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on February 19, 2020, 11:38:44 pm
Quote
So for me have more sense make default the aliased.

Well that's for pixel art only. For general painting, image editing and drawing is better to don't see the pixels.

Ok, sounds good to me.

So antialiased = alisado and antialiasing = alisamiento
And aliased = afilado

Yes that sounds good to me too.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: garlar27 on February 20, 2020, 04:25:02 pm
@garlar: no estoy seguro de que este "afilar" es a propocito de antialiasing.

Cuando se trace una ruta, es escrito anti-alias:
Sorry, its almost 25 years since the last time I played with image editing  :-[
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on February 20, 2020, 05:46:17 pm
Maybe they noticed, maybe they didn't, but just in case I'll comment
The shape coordinates/size is not visible using the edit shape tool.
https://i.ibb.co/jhWZ0Hh/sshot-001.png
https://i.ibb.co/KmMs7m8/sshot-002.png

btw circular, can you port lazpaint to haiku?
this operating system is in "beta"state now, and if I'm not mistaken, there are many tools available
I think have freepascal, qt, etc
It's not a necessity, but it would be a nice thing and well received for haiku users.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on February 21, 2020, 02:40:38 pm
Thanks for spotting it.

Porting it to haiku, well that could be cool, but I don't have enough time for that. I would need the help of a haiku user/programmer.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on March 03, 2020, 03:41:04 am
Can be nice if the gradient tool is able to use more than 2 colors, to make an rainbow as this ;P
https://i.ibb.co/Y7sFHx1/stylepix-gradient.gif

Other thing which I like really in lazpaint is play with the curve tool, with close shape, and fill this with color, so I don't need colore nothing manually and I can change the color of every detail quickly.
For me is a cool way to make draws :P

But at same time that method is limited by one color, so is not possible make an "gradient fill" too?
I know we can make a selection and make that, but I would like a option to make the custom fill in shapes.

Another thing I've been thinking about for a time is have a option to merge shapes making from these one shape (by curve)
By example a circle with a line in the center, like the Yin-yang, to make this we need make first the circle, then make the line, and fill black here, white there but the coloring process is a bit long even to make just that.
Then if we can merge the circle and the line in one, we can just make a black fill and a white fill.
Of course the usefulness of merging forms can be more than just that.

What you think?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 03, 2020, 11:52:38 am
Done more than 2 colors is indeed a possible improvement. Please add it in GitHub if it is not there.

About gradient fill in shapes, that's already in dev branch. You can as well use a texture.

I think this version is ready for testing so I will publish binaries very soon.

About merging shapes, that may be possible, though not so obvious. You can add a ticket for that, though I am not sure how this would pan out.

There is a new feature already that may help here. You can draw a rectangle or a circle, and transforms it into a curve. So then you can edit it as you like.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on March 03, 2020, 06:34:53 pm
Quote from: circular
About gradient fill in shapes, that's already in dev branch. You can as well use a texture.
Great! :D

Quote from: circular
About merging shapes, that may be possible, though not so obvious. You can add a ticket for that, though I am not sure how this would pan out.
Sorry, I think I didn't expressed correctly my idea.

The idea basically is allow make in the shapes interceptions/connect points.
For example, see how it works in a 3D modeler like Wings3D
https://i.ibb.co/rcpx5fK/shape-with-interceptions.gif
We can already add new points and move them, but no connect them

Quote from: circular
I think this version is ready for testing so I will publish binaries very soon.
I'm really excited about the next version, I think it's gonna be really great :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 03, 2020, 10:21:15 pm
The idea basically is allow make in the shapes interceptions/connect points.
For example, see how it works in a 3D modeler like Wings3D
https://i.ibb.co/rcpx5fK/shape-with-interceptions.gif
We can already add new points and move them, but no connect them
I think I got it. That's very interesting. I wonder how to implement the rendering of that.

I am thinking that any point can have any number of connections then. This results in a graph (in graph theory) and from there we would need to determine all the "holes" or closed loops. And then each hole can be filled with a specific gradient/texture.

Is it what you're thinking about?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on March 04, 2020, 01:17:18 am
Yeah! Also you got the point about fill each hole individually, even although are from same shape, are divided but connected :)
I forgot to mention it, although it's the reason because at the end of the gif I selected a part (marked as red)

Do I create a ticket for this then?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 04, 2020, 02:37:38 pm
Yeah why not. I like the ide but I don’t know how am gonna do that.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 07, 2020, 01:37:04 pm
New version LazPaint 7.0.8 beta is available for testing. It is provided as an compressed archive only and not designed to be installed.

The binaries contain debug information so it is a large file and it is a bit slow on startup. The final version will be smaller and faster.

https://github.com/bgrabitmap/lazpaint/releases

Files
  * read support for Portable Any Map (PBM, PGM, PPM)
  * read/write support for WebP images using libwebp
  * read support for RAW images using dcraw
  * fix loading PDN images
  * show progress of loading/saving/actions on layered images

Tools
  * scripting in Python
  * scripts provided: color overlay, drop shadow, split/merge channels...
  * vectorial tools: gradient and texture fill for vectorial shapes
  * paste vector shapes within visible bounds
  * tools: align to pixels when image is not zoomed
  * tools: grouping of items in toolbar
  * added polyline and opened curve tool
  * pen tool: SHIFT click to retrieve color, ALT+wheel to change width
  * selection pen tool: add antialiasing option
  * color picker: SHIFT click to retrieve color of flattened image
  * eraser tool: added lighten, darken and sharpen modes
  * floodfill tool: makes vector original on an empty layer
  * edit shape tool: show shape information
  * polygon tool: highlight hovered point, arrows to move points

Windows
  * palette: indicate last added color in palette
  * palette: fix scroll bug
  * color window resizable
  * color and layer windows dockable to main window
  * adjust more windows to system DPI
  * adjust curves: show source histograms
  * filter function: optimize, add Lab colorspace, add min/max/avg
  * blend operations: add Saturation (HSL) and Mask blend operation

Miscellaneous
  * rendering optimizations to reduce slowdown with big images
  * added Kabyle language
  * updated Swedish translation
  * fixes for image browser
  * command line: parenthesis optional to make it Linux-friendly
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on March 07, 2020, 03:42:47 pm
Great work.

About the multi fill thing I've not seen that in 2d vector software only on 3d
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 07, 2020, 05:37:54 pm
That would be a unique feature then.

My neurons are trying to figure out how to make it. I think I know how to make the pen. For know it is computed on one closed loop, a polygon. Both left side and right side are done at the same time. With connections between points, they need to be done separately. For example the outer side of the shape can go around in one loop, but the inner side can be two different loops.

For the filling part, I suppose it can be deduced from the loops, but it is not clear to me how to know which loop to fill. Probably the longest loop is the outer loop and must not be filled while the smaller loops must be, but I wonder if there are exceptions. Also if the connection between two points goes crosses over the main loop, then some surface is theoretically filled by two inner loops at the same time.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on March 08, 2020, 03:14:41 am
I must admit that at first I was a little confused about a few things with the new version
as how close the shape, however I think have more sense now :)
or about how works the gradient now, Indeed I thought for a moment that the tool itself had been removed, for only the option of making gradients by means of shapes or lines, but then I saw that it was grouped with the eraser heh ;P
Filling in the shapes with gradients is really cool, though I taked a little practice to understand how various things work :)

Finally the colors and layers are well docked haha

I think are many things to comment, but is really good this new version :D

Btw, this is a problem from before, the selection don't works in the corners or close from (selection area is limited as 70% from center?)
https://i.ibb.co/r540jnq/lazpaint-selections-Limits.gif
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on March 08, 2020, 03:55:14 am
Is possible to have the ability to export/save in vectorial image format? as SVG.
btw, this svg image is not opened properly
https://upload.wikimedia.org/wikipedia/commons/3/30/Vector-based_example.svg
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 08, 2020, 11:06:11 am
I must admit that at first I was a little confused about a few things with the new version
as how close the shape, however I think have more sense now :)
or about how works the gradient now, Indeed I thought for a moment that the tool itself had been removed, for only the option of making gradients by means of shapes or lines, but then I saw that it was grouped with the eraser heh ;P
Filling in the shapes with gradients is really cool, though I taked a little practice to understand how various things work :)
Yeah there are some changes though hopefully for the better.

Quote
Finally the colors and layers are well docked haha
:D Indeed

Quote
I think are many things to comment, but is really good this new version :D
Thanx

Quote
Btw, this is a problem from before, the selection don't works in the corners or close from (selection area is limited as 70% from center?)
https://i.ibb.co/r540jnq/lazpaint-selections-Limits.gif
Yeah because when using the corner to resize, it is better to have the mouse on the corner. Otherwise I think that when you rotate the shape (using right-click) than can be a bit confusing.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 08, 2020, 11:07:48 am
Is possible to have the ability to export/save in vectorial image format? as SVG.
btw, this svg image is not opened properly
https://upload.wikimedia.org/wikipedia/commons/3/30/Vector-based_example.svg
That's a possible improvement. Though if you have raster stuff in there, the SVG file could get very large.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on March 08, 2020, 06:26:32 pm
That's a possible improvement. Though if you have raster stuff in there, the SVG file could get very large.
I understand, however it would be great.
for now I play very little with raster stuff when I do "my drawings" :P
---
Some days ago while playing Hollow Knight made me want to remake an image...

First, make the shapes and fill them
https://i.ibb.co/H7jXVz9/hk-normal.png

try the new gradient fill in the "flower"
https://i.ibb.co/gSyKWQJ/hk-gradient1.jpg

Redid the gradient in flower, some of gradient for the character too, why not? :P
https://i.ibb.co/b1P3GqK/hk-gradient2.jpg

Gradient for lines in flower, although I like, I'm not sure
https://i.ibb.co/HTQwVnd/hk-gradient3.png

Ok, I thinned out the lines
https://i.ibb.co/YdKMVtY/hk-gradient4.png
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 08, 2020, 06:50:25 pm
Nice drawing.  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on March 12, 2020, 07:42:38 am
In the debug versions there are "Scripts". When I try to run I get "You have Python version..., but you need."
IMHO, It would be better if the msgbox contained a hyperlink to a python download site, especially for those who have no idea what Python is.

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on March 12, 2020, 07:11:54 pm
That's a fair point.

I've added a Download button when showing the error message for Python.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on March 15, 2020, 09:34:12 pm
Hi! I'm back with another short message :D (sorry but is not ;P)

---
Ummm, about python scripts I will personally avoid it, I don't want install python in my system :P
However I wonder, is not possible make this as an DLL, or embbed in some way? without overload LazPaint ofcourse.

By example Madedit-Mod have Python as Macro language for automation(Run/Rec/Playback, local script list) and works ok.
https://github.com/LiMinggang/madedit-mod
The win32 binary which I have here, are just 6,74mb :P

Python 3.8.2 is 41mb installed

Can be nice to have scripts support without need of install the whole python, I know in almost Linux system is included by default, but not in Windows :P

---

I recently noticed the colors window have hexadecimal notation too haha, also using with the palette panel is really comfortable, I didn't bother to try both options before, but are really good :)
By other side I taked note of some things

Is not possible change the secondary color with the Colors window, ie, we need first change the main color and switch to secondary, could be nice if we can change both colors directly, as with left and right click for each one, as in the palete bar.
Is not possible change the Grandients colors with Colors window or the palete bar.
if I'm not wrong I guess you will improve this along with the "Gradient with more colors" issue anyway.
Although having the two colors of gradient in the main bar (preview) is functional, I think is not very comfortable.

---

If is not a big trouble can be nice if we can resize colors windows and layers (horizontally) when are docked

---

I recently added some small details to a image for a friend, the original image was made in Adobe Illustrator by someone else, but just for fun and test the Gradient fill and Opened Curve tools I recreated the image in LazPaint.
Original image https://i.ibb.co/WK4w1ky/orignalimage.png
Recreated image https://i.ibb.co/9Nh6bmH/recreatedimage.png

I think is interesting view how something was made in heavy professional software as Adobe Illustrator and how can be in LazPaint :)

But ok, anyway Illustradot is probably a very used desing software, so can be nice have the option Import their file format at least.
By example to open a image made in illustrator with Gimp we need first open in Inscape and export to some other format as SVG and open the with Gimp.
Although I readed the Inscape support for that format is limited, so maybe is complicated? :P

---

Well, I think is all for now.
For now :P
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on March 19, 2020, 06:36:00 pm
Please add a option to resize a layer individually, I know we can make this with the tool in layers, but sometimes we need resize a layer with some specific value and make this by hand can be a bit complicated.
I think something as a selector in the resize window to select all or "x layer" can be enough :P

I think in something as a selector in the resize window to select "all layers" or "x layer"

Add button to zoom 1:1, I guess with the asteric * in numeric keyboard
Other to zoom to fit in window? the divide in numeric keyboard? :P
The zoom to fit in the window, I think can be nice if also centers the image too
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on March 28, 2020, 04:56:49 pm
I think the Darken/Lighten tools need to be improved a bit
See how the Darken/Lighten tool is in LazPaint and Phoxo
lazpaint https://i.ibb.co/s3DWkhd/lazpaint-lighten-darken-tool.gif
phoxo https://i.ibb.co/rMy0zpD/phoxo-lighten-darken-tool.gif

lazpaint https://i.ibb.co/jJHwWDD/lp-demo1.gif
phoxo https://i.ibb.co/vXCYGMr/px-demo1.gif

I guess the effect should only be passed through the same areas until you click again
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 01, 2020, 11:33:00 am
Please add a option to resize a layer individually, I know we can make this with the tool in layers, but sometimes we need resize a layer with some specific value and make this by hand can be a bit complicated.
I think something as a selector in the resize window to select all or "x layer" can be enough :
That is a bit like what you are asking for shapes, so maybe I will make it the same way like editing the status bar.

Quote
Add button to zoom 1:1, I guess with the asteric * in numeric keyboard
Other to zoom to fit in window? the divide in numeric keyboard? :P
The zoom to fit in the window, I think can be nice if also centers the image too
Oh you're talking about adding a shortcut key. Ok. Good idea.
https://github.com/bgrabitmap/lazpaint/issues/133
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 03, 2020, 02:49:48 pm
New test version of LazPaint 7.0.9 beta  :)
https://github.com/bgrabitmap/lazpaint/releases

Hopefully this version will have no more bugs.  :-[

  * interface: less flickering during action progress
  * interface: minor scaling improvements
  * interface: ensure toolwindows in front when restoring app
  * interface: dark theme for status bar
  * interface: add Donate tool button
  * interface: add Python download button if missing
  * interface: separate color for background and outline
  * interface: don't undock windows when going fullscreen
  * interface: fix remember save file extension
  * translation: added Latvian
  * translation: completed Kabyle and Bulgarian
  * tool: fix updating transparent colors
  * tool: fix release of middle mouse button
  * tool: optimize layer transform
  * tool: added font aliasing option
  * tool: replace layer by gradient if it is opaque
  * tool: floodfill using vector if possible
  * tool: fix gradient undo/redo
  * tool: multiselection of shapes
  * tool: fix text editor handling of keys
  * script: sort in menus
  * script: added inner shadow/light
  * script: added version function
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: jex on April 03, 2020, 04:42:23 pm
Amazing work!
I have a noob question tho, I downloaded the code but failed to understand exactly how do you run python scripts from lazarus?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 03, 2020, 05:20:16 pm
For now, I'm running scripts by running the script as from command line. Under Windows, that's:
Code: [Select]
pyw thescript.py
Then I interact with the process input and output pipes. Basically I read the output of the process to know the issued commands and write in the input the answers to the function calls.

That's not the most efficient way to interact, but it avoids having to deal with the API that I found a bit confusing to use. Anyway scripts do not require a high quantity of exchange data.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on April 05, 2020, 02:33:21 am
Thanks you very much by the new version circular, greatfull as always :D
and thanks for adding my requests also of course, I know are many :)
but yeah, thanks by the multiselection of shapes, add the font aliasing option, make the dark theme for status bar, and maybe some others that I forgot heh.

I think the interface gets nicer with every update, and it's been good from the start :)

I asked you before if possible have SVG as option to save files, but I wonder also if possible add SVG edit or well, if that is too much complicated, maybe something as import the SVG as Lazpaint vectors?

btw, I find interesting that lazpaint has Perlin noise render but haven't a Noisy render (that which is a lot of points), add that please, can have some useful uses, as to make some TV White noise, generate a star field, etc.

by example: how to generate star fields from noise
https://mike42.me/blog/2018-01-howo-to-generate-star-fields
I guess that can be added as script if we have a noisy render

also I think can be cool if add also a "space generator" script
to do something as this website, but in lazpaint
http://wwwtyro.github.io/procedural.js/space/
I think this is doable playing with render clouds (nebulae) + some circles and blur (sun) + noise (stars points)

Of course this is just a idea to have a cool script :P
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 05, 2020, 11:29:00 am
Hi Carlos

Happy you like the new version!  :)

If you find bugs please tell me!

Editing SVG may be too complicated but converting it as LazPaint vector is something I thought about. The problem is that first I need to add a Path shape in LazPaint. And for that I need to implement the arc transforms.

About the noise, I think there is the one you're looking for. In Filter > Noise filter.

That's some cool ideas of script there. Well, would you like to try to write some?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on April 05, 2020, 04:17:53 pm
Yes you can try the noise filter is the most easy to do.
Just random number between 0 and 1. between 0 and 0.5 use black and if greater than 0.5 use white.
You can change the threshold (0.5) to have more black or more white.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on April 10, 2020, 03:19:06 pm
Quote from: circular
About the noise, I think there is the one you're looking for. In Filter > Noise filter.
Oh, the noise is in filters, yeah that is! :D

Quote from: circular
If you find bugs please tell me!
Ah actually I found one that I forgot to comment on before.
The scroll with middle mouse button it is not completely corrected, at least not in windows, the scroll with this button is locked if if we select a different tool than the "hand" (Move and scroll picture tool)
I guess you can check this with Reactos or Wine.

Quote from: circular
Editing SVG may be too complicated but converting it as LazPaint vector is something I thought about. The problem is that first I need to add a Path shape in LazPaint. And for that I need to implement the arc transforms.
I see, well I hope we can see this in the future, although it is not a high priority it would be quite useful.

Quote from: circular
That's some cool ideas of script there. Well, would you like to try to write some?
Yeah, I will make my questions about scripts here later :)

Quote from: circular
Yes you can try the noise filter is the most easy to do.
Just random number between 0 and 1. between 0 and 0.5 use black and if greater than 0.5 use white.
You can change the threshold (0.5) to have more black or more white.
Good, I'll keep this in mind, will be useful :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 10, 2020, 03:55:27 pm
Ah actually I found one that I forgot to comment on before.
The scroll with middle mouse button it is not completely corrected, at least not in windows, the scroll with this button is locked if if we select a different tool than the "hand" (Move and scroll picture tool)
I guess you can check this with Reactos or Wine.
Ah indeed, same thing on Linux. But we have already done the binaries. I will ask if it is ok with Lainz to make a new version.

Quote
Quote from: circular
That's some cool ideas of script there. Well, would you like to try to write some?
Yeah, I will make my questions about scripts here later :)
I suggest to create a thread for that.

Quote
Quote from: circular
Yes you can try the noise filter is the most easy to do.
Just random number between 0 and 1. between 0 and 0.5 use black and if greater than 0.5 use white.
You can change the threshold (0.5) to have more black or more white.
Good, I'll keep this in mind, will be useful :)
That was Lainz quote.  :-[
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 10, 2020, 05:19:50 pm
New STABLE version of LazPaint 7.1.1
https://github.com/bgrabitmap/lazpaint/releases
 8-)

What's new compared to previous stable version 7.0.7:

Files
  * read/write support for WebP images using libwebp
  * read support for RAW images using dcraw
  * read support for Portable Any Map (PBM, PGM, PPM)
  * fix loading PDN images
  * show progress of loading/saving/actions on layered images

Interface
  * less flickering during action progress
  * minor scaling improvements
  * dark theme for status bar
  * add Donate tool button
  * separate color for background and outline
  * fix remember save file extension

Tools
  * fix updating transparent colors
  * fix release of middle mouse button
  * fix gradient undo/redo
  * optimize layer transform
  * scripting in Python
  * script for layer effects: color overlay, drop shadow, inner light, stroke
  * more scripts: split/merge channels, mask
  * vectorial tools: gradient and texture fill for vectorial shapes
  * paste vector shapes within visible bounds
  * align to pixels when image is not zoomed
  * grouping of tool items in toolbar
  * added polyline and opened curve tool
  * pen tool: SHIFT click to retrieve color, ALT+wheel to change width
  * selection pen tool: add antialiasing option
  * color picker: SHIFT click to retrieve color of flattened image
  * eraser tool: added lighten, darken and sharpen modes
  * floodfill tool: makes vector original on an empty layer, preserve vector layer
  * edit shape tool: show shape information
  * edit shape tool: multiselection of shapes
  * polygon tool: highlight hovered point, arrows to move points
  * text tool: added font aliasing option
  * text tool: fix handling of keys
  * gradient tool: replace layer by gradient if it is opaque

Windows
  * ensure toolwindows in front when restoring app
  * palette: indicate last added color in palette
  * palette: fix scroll bug
  * color window resizable
  * color and layer windows dockable to main window
  * don't undock windows when going fullscreen
  * adjust more windows to system DPI
  * adjust curves: show source histograms
  * filter function: optimize, add Lab colorspace, add min/max/avg
  * blend operations: add Saturation (HSL) and Mask blend operation

Translations
  * added Latvian
  * completed Kabyle and Bulgarian
  * added Kabyle language
  * updated Swedish translation

Miscellaneous
  * rendering optimizations to reduce slowdown with big images
  * fixes for image browser
  * command line: parenthesis optional to make it Linux-friendly

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on April 10, 2020, 05:46:46 pm
Thanks for this release, is the faster and complete graphics application.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 10, 2020, 07:34:25 pm
Thank you  :-[
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 11, 2020, 08:03:50 am
Talking about night sky, here is a picture I just made with LazPaint
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: silvestre on April 11, 2020, 10:04:06 am
Dear Circular, Lainz and others,

Fantastic work done in Lazpaint, with constant development and a great library behind, this software is becoming a first choice graphic application. 

I would like to suggest a little feature for next revisions, and that is in the section to open file and save, for example, in the windows version to have some basic shortcuts (Desktop, network folders,..), the basic ones. I think it would help to handle the file system a little faster and more directly.

Thank you very much for your work!

New STABLE version of LazPaint 7.1.1
https://github.com/bgrabitmap/lazpaint/releases
 8-)

What's new compared to previous stable version 7.0.7:

Files
  * read/write support for WebP images using libwebp
  * read support for RAW images using dcraw
  * read support for Portable Any Map (PBM, PGM, PPM)
  * fix loading PDN images
  * show progress of loading/saving/actions on layered images

Interface
  * less flickering during action progress
  * minor scaling improvements
  * dark theme for status bar
  * add Donate tool button
  * separate color for background and outline
  * fix remember save file extension

Tools
  * fix updating transparent colors
  * fix release of middle mouse button
  * fix gradient undo/redo
  * optimize layer transform
  * scripting in Python
  * script for layer effects: color overlay, drop shadow, inner light, stroke
  * more scripts: split/merge channels, mask
  * vectorial tools: gradient and texture fill for vectorial shapes
  * paste vector shapes within visible bounds
  * align to pixels when image is not zoomed
  * grouping of tool items in toolbar
  * added polyline and opened curve tool
  * pen tool: SHIFT click to retrieve color, ALT+wheel to change width
  * selection pen tool: add antialiasing option
  * color picker: SHIFT click to retrieve color of flattened image
  * eraser tool: added lighten, darken and sharpen modes
  * floodfill tool: makes vector original on an empty layer, preserve vector layer
  * edit shape tool: show shape information
  * edit shape tool: multiselection of shapes
  * polygon tool: highlight hovered point, arrows to move points
  * text tool: added font aliasing option
  * text tool: fix handling of keys
  * gradient tool: replace layer by gradient if it is opaque

Windows
  * ensure toolwindows in front when restoring app
  * palette: indicate last added color in palette
  * palette: fix scroll bug
  * color window resizable
  * color and layer windows dockable to main window
  * don't undock windows when going fullscreen
  * adjust more windows to system DPI
  * adjust curves: show source histograms
  * filter function: optimize, add Lab colorspace, add min/max/avg
  * blend operations: add Saturation (HSL) and Mask blend operation

Translations
  * added Latvian
  * completed Kabyle and Bulgarian
  * added Kabyle language
  * updated Swedish translation

Miscellaneous
  * rendering optimizations to reduce slowdown with big images
  * fixes for image browser
  * command line: parenthesis optional to make it Linux-friendly
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 11, 2020, 10:24:24 am
Glad you like it  :)

Hmm I suppose some shortcuts could be added, though network drives do not appear when you click the "Select drive" button?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: silvestre on April 11, 2020, 11:21:31 am
Dear Circular,
Using the drive icon I get generic access to C:
I am using Windows 10. 

Glad you like it  :)

Hmm I suppose some shortcuts could be added, though network drives do not appear when you click the "Select drive" button?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 11, 2020, 02:00:07 pm
Hmm but you have network drives defined like D: E: etc.?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: silvestre on April 12, 2020, 02:21:54 am
Hi Circular,

There are no associated letters in this case, the search was on shared folders, (Network section), I attach example screen.

Hmm but you have network drives defined like D: E: etc.?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 12, 2020, 10:06:35 am
Oh ok, so maybe what would suit your need would be a network button that shows the computers on the network?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: silvestre on April 12, 2020, 02:20:47 pm
Hi Circular,

Since the archive section involves other systems beyond Windows, perhaps this particular feature complicates development more than it might initially appear, and I know your time is valuable. I wouldn't want to bother you with non-essential issues.

I think, that we can also create links to network folders in other places, and solve this feature from the user side, without further changes. Regarding the link to the desktop, as lazpaint allows us to save frequently used folders, we can also solve it easily.

Oh ok, so maybe what would suit your need would be a network button that shows the computers on the network?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 13, 2020, 12:00:50 am
I don't know how complicated it is to add the shortcuts defined in the explorer. I cannot investigate easily because I don't have a local network ready.

Regardless your suggestion is interesting. I will add it. Maybe someone that works on Windows and has a network can help me examine it.
https://github.com/bgrabitmap/lazpaint/issues/146
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on April 14, 2020, 04:58:58 am
I think the lazpaint image browser should be redesigned a little better

Lazpaint image browser
https://i.ibb.co/j8LJJw8/lazpaint-filebrowser.png

Windows file browser (with lazpaint)
https://i.ibb.co/vJ2G4ZP/lazpaint-openwindow.png

RealWorld Paint file browser
https://i.ibb.co/6D3XVPF/rwpaint-openwindow.png

the "path" box, in windows displays a directory tree (where says "equipo")

The RealWorld Paint file browser although is a customized one, is very similar with the Windows File Browser, by example this have quick access icons to "My documents", "Desktop" and "Computer".
I guess can be good if some common directories are added in the Lazpaint image browser in a lateral panel as in the others, with "My Documents", "Desktop", "Drives", "Network Drives" etc

Something wich I found cool in RWPaint is that your file explorer is integrated in the main window, it does not open a new window as such.
---

Lazpaint image browser
https://i.ibb.co/g4RBPC9/imagebrowser.png

A mockup idea
https://i.ibb.co/DYWGyvd/imagebrowser-mod.png

The "save" dialog wastes unnecessary space
https://i.ibb.co/09BQ5TF/savedialog.png

Another mouckup idea :)
https://i.ibb.co/KyMnbXY/savedialog-mod.png
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 14, 2020, 12:02:31 pm
Something wich I found cool in RWPaint is that your file explorer is integrated in the main window, it does not open a new window as such.
Quote
A mockup idea
https://i.ibb.co/DYWGyvd/imagebrowser-mod.png
I get the idea, though I am not motivated to do such change because it is already nice. I don't mind my software being a bit different.

Quote
The "save" dialog wastes unnecessary space
https://i.ibb.co/09BQ5TF/savedialog.png

Another mouckup idea :)
https://i.ibb.co/KyMnbXY/savedialog-mod.png
Well that works in this case, but save a JPEG and more space is used on the left side.

That said, I agree it would be nice to have network access.

About having Desktop, the thing is I did not find a consistent way of getting the Pictures directory on Linux, so I have put by default the user directory. So it is kind of a generic default directory. From there you can go to Desktop or Pictures.

On Windows, I there is a consistent way of getting the Pictures directory so I have put that by default, and from there you can go one directory up and then choose any user directory. As path are easily accessible on the right part of the screen, I guess it is ok.

I did not want to make the interface too different depending on the system by adding special buttons.

Though if we start adding Network shortcuts, then why not try at that point to make a kind of dynamic list of shortcuts that could include any OS specific ones.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on April 15, 2020, 05:21:39 pm
Quote from: circular
I get the idea, though I am not motivated to do such change because it is already nice. I don't mind my software being a bit different.
Heh it's ok then :)

Quote from: circular
Well that works in this case, but save a JPEG and more space is used on the left side.
https://i.ibb.co/Zm9wcM9/savejpg.png

It's doable too :P
https://i.ibb.co/9y6pfQR/savejpg-mod.png
I included the "Lossless" option from webp save

even if the format have many options, this can be made better :P
https://i.ibb.co/0Jyb784/savejpg-mod2.png
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 15, 2020, 07:31:25 pm
Ok ok you make a point. Let's add that to the issue list then.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on April 15, 2020, 08:29:11 pm
heh ok thanks :)
https://github.com/bgrabitmap/lazpaint/issues/148
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on April 19, 2020, 07:00:55 pm
Ummm this last lazpaint version is a bit unstable?
At least in my case it has closed completely several times while using it, Windows 7 x86.
Some program to make a crash log?
I looked in windows event viewer but can't find anything from Lazpaint, well, just some old logs from 7.0.7, but nothing about 7.1.1
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 19, 2020, 07:11:14 pm
Oh? What happens exactly? Does it show a message?

With a debug version in principle you will get some extra information.

Let's make some.

You have Win32 then?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on April 19, 2020, 08:28:38 pm
It doesn't show any message, it just closes completely.
If it is useful here I leave the log in CSV and PML (to see in ProcessMonitor)
https://www.mediafire.com/file/9cilqu1gwwepafw/ProcessMonitor_LazPaint_Logs01.7z/file

Yes, I have Win32, I can try with a debug version if you want :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 19, 2020, 09:33:12 pm
Hmm that log is interesting though I don't really understand it.

Yes, please try the debug version, it is less likely to crash instantly.

If you get an error message, please take a screenshot.  :)

I have made debug binaries for you. Lainz helped be as well.
https://github.com/bgrabitmap/lazpaint/releases

Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on April 19, 2020, 10:24:48 pm
Hehe yeah, that debug version was less likely to crash instantly, I was starting to think I wouldn't have any crashes and end up not finding the problem heh, but yes, in the end after using for a few minutes there was an error.
This gives me many error windows, every time you press Ok comes back with another error window, I guess I normal with this debug version.
So I taked 41 screenshots and then I closed lazpaint with the task manager.
I hope with this we can found the problem, in any case let me know if I can do anything else :)
https://www.mediafire.com/file/gpdkh1c5s65tlai/lazpaint-error-log.zip/file
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 19, 2020, 10:49:59 pm
Wow thanks I would have been happy with just a few screenshots. :)

Are there particular actions that you think triggered this?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on April 19, 2020, 11:35:43 pm
Well I'm using the Opened Curved tool much. I have a whole drawing made with opened curves hehe
I guess is something related to the amount of points and curves in a project :P
Look the drawing, since everything is a opened curve maybe you find it interesting :)
https://www.mediafire.com/file/utael9vx6wf4y8t/digitalized-sketch-girl.7z/file

Is not complete, but I think almost, I like how it looks, although it was difficult to do the hair hehe.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 20, 2020, 10:06:00 am
Very nice drawing.  :)

I have added the issue:
https://github.com/bgrabitmap/lazpaint/issues/149

Thanks  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 24, 2020, 02:53:50 pm
New version of LazPaint (7.1.2)
https://github.com/bgrabitmap/lazpaint/releases

I made Linux 32/64 binaires. I need some help for Windows 32/64 and MacOS 32/64 binaires.

installer on Windows:
- add scripts
- add new extensions (oXo, cur, jpeg, tif, tga, webp, xpm)

rendering fixes:
- phong shape undo
- vector layer with selection
- add font kerning for text shape

file browser:
- load thumbnails in separate thread to prevent freeze
- generate less file extensions to avoid slowdown

crash fixes:
- skip when matrix transform is invalid
- catch tablet initialization error
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on April 24, 2020, 06:21:25 pm
Done Win32 and Win64 zip and installer.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on April 24, 2020, 06:22:57 pm
The Linux32 deb and no install seems that has a big download size? Maybe it has debugging data inside?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on April 24, 2020, 08:33:49 pm
Thanks for the update circular, and thank you so much by windows binaries lainz :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on April 24, 2020, 08:38:54 pm
The Linux32 deb and no install seems that has a big download size? Maybe it has debugging data inside?
Ooops that's probably that. I am fixing it now.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 14, 2020, 12:56:22 pm
New version of LazPaint 7.1.3
https://github.com/bgrabitmap/lazpaint/releases

Recommended upgrade as it contains some bug fixes.

Linux 32 and 64bit binaries provided. I need help to make Windows and MacOS binaries.

Clipboard
- Fix pasting image in 24-bit with transparent color (via BGRABitmap)
- Fix undo of selection

Tools
- Text: better handling of character groups
- Curve: assign line cap, fix bounds for square cap

Interface
- Fix context menu on fill controls
- Update Czech translation
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 15, 2020, 03:41:19 am
I can make Windows binaries, my question if is there is any problem with that FreeType code that doesn't compile in trunk, if commenting that lines affects something in LazPaint. (https://forum.lazarus.freepascal.org/index.php/topic,24239.msg362253.html#msg362253)

About Mac, my machine has some problems with the charger cable or with the charging port, I'm not sure, so for now I can't compile for mac until I found some mac service to fix it.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 15, 2020, 07:35:40 am
BGRAFreeType is not used for now in LazPaint, so that doesn't matter.

Though you wouldn't have to do that. Trunk is not stable so I would rather avoid using it to release binaries. Rather user 2.0.8 where the code for CharKerning will be disabled by a compiler directive.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: lainz on May 16, 2020, 01:52:25 am
BGRAFreeType is not used for now in LazPaint, so that doesn't matter.

Though you wouldn't have to do that. Trunk is not stable so I would rather avoid using it to release binaries. Rather user 2.0.8 where the code for CharKerning will be disabled by a compiler directive.

Ok, I'm downloading the releases for 32 and 64 bit, and making the binaries now.

Edit: done binaries for win32 and win64, no install and setup  :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on May 16, 2020, 06:37:02 am
Thanks  :) :)
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on July 22, 2020, 06:41:27 pm
Talking about night sky, here is a picture I just made with LazPaint
Haha I had not seen it until now, cool :D

A idea that I wanted to comment on a long time ago, we have 'Polyline' and 'Opened Curve' (vectorial drawing tool) and 'Simple pen' (raster drawing tool)
In vector software like Adobe Illustrator or Xara Xtreme we have the 'Simple pen' too, but this convert the "raster" input drawing to vector lines.

With that in mind, I think could be nice a "Vector pen" drawing tool in Lazpaint, you know, we draw as with the simple pen, but then this is converted to 'Opened curve'

Free hand vector drawing with Xara Xtreme Pro
https://i.ibb.co/0tLVjYW/xara-freehand.gif

Free hand vector drawing with Adobe Illustrator
https://i.ibb.co/T4tgmqk/illustrator-freehand.gif

Also I found very interesting the erase tool from Illustrator.

What you think?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: CM630 on September 14, 2020, 10:48:13 pm
Most programs (maybe all except LazPaint) close the printing dialog, when printing is done.
LazPaint is an exception, and that confuses me... I wonder if I have pressed „Print“ or not.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: winni on September 14, 2020, 11:10:37 pm
Hi!

Yes, it is irritating.
Especially when a workmate has right before you send 50 pages to the printer.

There should be some information that the print job is in the pipe.

* Play a Beep
* Change the color of the print dialog
* or just close it.

Winni
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 16, 2020, 10:43:52 am
With that in mind, I think could be nice a "Vector pen" drawing tool in Lazpaint, you know, we draw as with the simple pen, but then this is converted to 'Opened curve'
Interesting. I've added the issue:
https://github.com/bgrabitmap/lazpaint/issues/194

There should be some information that the print job is in the pipe.

* Play a Beep
* Change the color of the print dialog
* or just close it.
Good idea. I've added a popup message and a counter for the number of times it has been sent to the printer.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: c-sanchez on September 26, 2020, 06:07:33 pm
Interesting. I've added the issue:
https://github.com/bgrabitmap/lazpaint/issues/194
Thanks :D
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 28, 2020, 11:05:22 am
Hi folks  :)

I am happy to announce a new version of LazPaint 7.1.4 on dev branch. It is not published yet.

It includes many bug fixes and also retina scaling for MacOS. Though it does not contain too much new code to avoid adding new bugs.

If you can, have the time to do so, here is how you can help me test:
- get latest version of BGRABitmap and BGRAControls (they are published)
- get latest version of LazPaint on dev branch (not published yet)
- play a bit with the software to see if there are no regressions
- check the features that have been retina-updated: multiselection, color chooser, adjust curves, pen preview, layer stack, new image, resample image, emboss, motion blur, import 3d object, image browser, blend operation
- check bug fixes: change deformation grid size, progressive magic wand, multiline text, aliased text
- new features: clone from other layer using Shift, print message and counter, gradient layer duplicate unlinked, display targeted color, palette to select gradient colors with Ctrl + Left/Right click

If all goes well, it will be published.

https://github.com/bgrabitmap/lazpaint/tree/dev-lazpaint

  * add --help command line
  * fix potential crashes
  * minor interface fixes
  * fix outline fill update
  * catch loading errors of layer originals
  * macOS: fix multiselection
  * macOS: handle retina display
  * macOS: optimize tools rendering
  * macOS: remove fullscreen menu (can be done with OS window menu)
  * tools: draw editor outside of image
  * choose color: display target name, highlight fill preview
  * palette: using CTRL to select gradient colors
  * raster selection: fix update area
  * clone tool: don't exit when changing layer
  * clone tool: shift-click to clone from flattened image
  * hand tool / edit shape tool: select non empty layer with shift-click
  * magic wand: implement progressive option
  * deformation grid: fix bug when changing grid size
  * text tool: optimize multiline text
  * print: show message and count
  * print: don't print empty image
  * curve adjustments: keep within limits when adding points
  * curve adjustments: fix toolbar position
  * gradient: don't link when duplicating layer
  * multiselection: remove hitboxes to allow selecting within
  * refactoring of debian package
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: OkobaPatino on September 28, 2020, 01:18:32 pm
Excellent job, Circular.

I just compiled it with FPC Trunk in Win64, tested many things, and all worked as expected.
Although I do not know how the duplicate with Shift and select gradient color with Ctrl work, can you explain it or maybe a test video?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 28, 2020, 04:52:10 pm
Thanks Okoba for testing.

About cloning, here is how it works. With an image with 2 layers, draw something in the left part of the first layer. Then choose clone tool and right click to set the source. Then select second layer and left click to clone.

Now for the Shift part, you can do the same as above, but instead of setting the source in the first layer, select second layer and shift right click on the left part. Then left click to clone. Note that now the source is the flattened image so it will clone in fact any layer.

About the gradient color, draw a rectangle with filling. Doesn’t matter at this point that it is filled with a gradient. Select the filling by clicking the little color preview in the back fill toolbar. Then you can ctrl click in the palette to set the gradient colors. Left for start color and right click for end color.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: OkobaPatino on September 28, 2020, 05:52:31 pm
You are welcome; thanks for the update.
Sorry but I could not make them work even after reading your instructions multiple times.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 29, 2020, 01:56:43 am
Hmmm sorry, in fact, it is shift left click to clone from flattened image. Right click always set the source to the current layer. Anyway.

Maybe I will do a video.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: OkobaPatino on September 29, 2020, 09:30:56 am
Maybe it is a good idea, as LazPaint grew a lot!
One thing I like the most is that after years of development and many features added, it still feels light and fast.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 29, 2020, 10:09:51 am
Cool  :)

Ok so I've added some popup message with the clone tool to explain when you need to right click the source. Basically to use the clone tool, you right click some pixels, and then left click somewhere else to copy them.

Also added that possibility of selecting the color target by clicking the label Pen or Back.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: OkobaPatino on September 29, 2020, 12:50:05 pm
Tested again, all are working fine.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 29, 2020, 05:00:01 pm
Cool.

Just added CMYK split script. Even though that's based on the theoretical standard CMYK that doesn't really exist, it can still be useful.

I realized that the divide and multiply blend modes where not very precise, so I fixed that in BGRABitmap on dev.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: OkobaPatino on September 29, 2020, 05:42:28 pm
Fast! Can you explain more the "CMYK split script"?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: circular on September 29, 2020, 06:02:09 pm
It is a script that will create 4 layers (or 5 if there is an alpha channel): cyan, magenta, yellow and black. They are subtractive (well in fact multiplicative) instead of being additive like light (red green blue). One can in theory print each channel on the same piece of paper and get the image.

Though to be accurate, one would need to have the color profile of the inks. Here it is based and sRGB assuming the primary colors cyan, magenta and yellow are those you can achieve with RGB (cyan = rgb(0,255,255), magenta = rgb(255,0,255), yellow = rgb(255,255,0)) which is not the case with printers.

It also assumes that the mix multiplicative which is also not the case with real inks. For example, if you mix all primaries you would not get a deep black but some dark color. Anyway that's what you will get if you look online for CMYK values or if you define CSS colors with CMYK.
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: OkobaPatino on September 29, 2020, 06:26:46 pm
Interesting. What are the use cases?
Title: Re: LazPaint (alpha-blending, antialiasing, filters)
Post by: winni on September 29, 2020, 07:34:08 pm
Hi!

Since the 60s the standard printing system of the print plants was the offset print.

If you work with the subtractive color system - in opposite to the monitor - you work with Cyan, Magenta, Yellow and Kontrast (=Black).

The CMYK modell is the last step in the prepress working bevor your work goes to the printing plant. Since the 90s you deliver a specialized PDF in high resultion.

From that PDF the colors are separated and the 4 plates in for C,M,K are are exposed.  In older days  you had to do that yourself, before the PDF goes to the printing press. Huge, huge PDFs.

Working in CMYK is not an easy thing: There is no alpha channel,  because the background by definiton is white.

And the second issue is: too much color for one pixel.
Assum a black area. You can create that with 100% K and the other colors at 0%.
But you can also turn all 4 Colors to 100%. Then you have 400% color and a big problem in the machine: 400% will make the paper so wet that it sticks on the roll.

So you never should have more