Recent

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

circular

  • Hero Member
  • *****
  • Posts: 3666
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #555 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.
Conscience is the debugger of the mind

CM630

  • Hero Member
  • *****
  • Posts: 925
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #556 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
« Last Edit: June 25, 2014, 07:48:32 am by paskal »
Лазар 2,0,10; W10 or W7 64bit; FPC3,2,0; rev 63526

circular

  • Hero Member
  • *****
  • Posts: 3666
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #557 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.
Conscience is the debugger of the mind

CM630

  • Hero Member
  • *****
  • Posts: 925
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #558 on: June 25, 2014, 05:38:10 pm »
I think these icons are a bit too os-specific. What about those ones?
Perfect  :D
Лазар 2,0,10; W10 or W7 64bit; FPC3,2,0; rev 63526

circular

  • Hero Member
  • *****
  • Posts: 3666
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #559 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.

 :)
Conscience is the debugger of the mind

CM630

  • Hero Member
  • *****
  • Posts: 925
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #560 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?
« Last Edit: June 25, 2014, 08:27:37 pm by paskal »
Лазар 2,0,10; W10 or W7 64bit; FPC3,2,0; rev 63526

circular

  • Hero Member
  • *****
  • Posts: 3666
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #561 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.
Conscience is the debugger of the mind

CM630

  • Hero Member
  • *****
  • Posts: 925
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #562 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?
Лазар 2,0,10; W10 or W7 64bit; FPC3,2,0; rev 63526

circular

  • Hero Member
  • *****
  • Posts: 3666
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #563 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.
Conscience is the debugger of the mind

Fahmy Rofiq

  • Jr. Member
  • **
  • Posts: 72
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #564 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. :)
Lazarus + FPC Trunk
Windows 10 x64

CM630

  • Hero Member
  • *****
  • Posts: 925
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #565 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.
« Last Edit: June 30, 2014, 10:50:37 am by paskal »
Лазар 2,0,10; W10 or W7 64bit; FPC3,2,0; rev 63526

circular

  • Hero Member
  • *****
  • Posts: 3666
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #566 on: July 01, 2014, 09:36:30 pm »
I will try that. Thanks for the help.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 3666
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #567 on: July 06, 2014, 11:12:36 pm »
I have uploaded the patch with some fixes.  :)
Conscience is the debugger of the mind

CM630

  • Hero Member
  • *****
  • Posts: 925
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #568 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.
« Last Edit: July 08, 2014, 03:04:10 pm by paskal »
Лазар 2,0,10; W10 or W7 64bit; FPC3,2,0; rev 63526

taazz

  • Hero Member
  • *****
  • Posts: 5365
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #569 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.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018