Recent

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

c-sanchez

  • Jr. Member
  • **
  • Posts: 65

circular

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

Okoba

  • Hero Member
  • *****
  • Posts: 528
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #962 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?

circular

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

Okoba

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

circular

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

Okoba

  • Hero Member
  • *****
  • Posts: 528
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #966 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.
« Last Edit: September 29, 2020, 12:15:57 pm by OkobaPatino »

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #967 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.
« Last Edit: September 29, 2020, 10:28:14 am by circular »
Conscience is the debugger of the mind

Okoba

  • Hero Member
  • *****
  • Posts: 528
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #968 on: September 29, 2020, 12:50:05 pm »
Tested again, all are working fine.

circular

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

Okoba

  • Hero Member
  • *****
  • Posts: 528
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #970 on: September 29, 2020, 05:42:28 pm »
Fast! Can you explain more the "CMYK split script"?

circular

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

Okoba

  • Hero Member
  • *****
  • Posts: 528
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #972 on: September 29, 2020, 06:26:46 pm »
Interesting. What are the use cases?

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #973 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 that 100% with CMYK colors.

The conversion goes this way:

Code: Pascal  [Select][+][-]
  1. procedure RGBtoCMYK(r,g,b: byte; var c,m,y,k : byte);inline;
  2. var r1,g1,b1,c1,m1,y1,k1 : single;
  3.  
  4.     begin
  5.       r1 := r/255;
  6.       g1 := g/255;
  7.       b1 := b/255;
  8.       k1 := max(r1,g1);
  9.       k1 := max(k1,b1);
  10.       k1 := 1-k1;
  11.       if k1 = 1 then
  12.          begin
  13.           c1 := 0; m1 := 0; y1 := 0;
  14.          end else
  15.          begin
  16.            c1 := (1-r1-k1) / (1-k1);
  17.            m1 := (1-g1-k1) / (1-k1);
  18.            y1 := (1-b1-k1) / (1-k1);
  19.          end;
  20.       c := round(c1*255);
  21.       m := round(m1*255);
  22.       y := round(y1*255);
  23.       k := round(k1*255);
  24.     end;
  25.  
  26.  
  27.  
Winni


Okoba

  • Hero Member
  • *****
  • Posts: 528
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #974 on: September 29, 2020, 07:39:07 pm »
Thanks winni, that was interesting

 

TinyPortal © 2005-2018