Recent

Author Topic: png alpha-transparency in linux  (Read 9607 times)

cd

  • Jr. Member
  • **
  • Posts: 54
png alpha-transparency in linux
« on: April 04, 2010, 07:29:22 pm »
compare the two following
wheres alpha in linux?

Troodon

  • Sr. Member
  • ****
  • Posts: 484
Re: png alpha-transparency in linux
« Reply #1 on: April 04, 2010, 10:02:47 pm »
That is antialiasing.
Lazarus/FPC on Linux

cd

  • Jr. Member
  • **
  • Posts: 54
Re: png alpha-transparency in linux
« Reply #2 on: April 05, 2010, 12:13:16 am »
No, that has nothing to do with antialiasing.
That is ignoring semi-transparent alpha-channel. pixels with alpha>0.5 are shown as fully opaque, alpha<0.5 is treated as fully transparent.

The same thing concerns 32bit icons, which are displayed well in windows, but have same coarse edge in lunix.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2510
Re: png alpha-transparency in linux
« Reply #3 on: April 06, 2010, 12:04:44 am »
Currently the routines we use for graphics drawing support 1-bit alpha only. Change is planned, but don't count on it soon.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

cd

  • Jr. Member
  • **
  • Posts: 54
Re: png alpha-transparency in linux
« Reply #4 on: April 06, 2010, 11:34:07 am »
is the code that is used in windows os-dependent?

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2510
Re: png alpha-transparency in linux
« Reply #5 on: April 06, 2010, 12:12:46 pm »
Yes, in windows, winapi functions are used
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

circular

  • Hero Member
  • *****
  • Posts: 3405
    • Personal webpage
Re: png alpha-transparency in linux
« Reply #6 on: April 11, 2010, 07:53:11 pm »
Ok, i added it. Try this with BGRABitmap :

Code: [Select]
uses BGRABitmap;

{...}

procedure TForm1.FormCreate(Sender: TObject);
begin
  png := TBGRABitmap.Create('somefile.png');
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  png.Free;
end;

procedure TForm1.FormPaint(Sender: TObject);
begin
  png.Draw(Canvas,0,0,False);
end;
Conscience is the debugger of the mind

cd

  • Jr. Member
  • **
  • Posts: 54
Re: png alpha-transparency in linux
« Reply #7 on: April 12, 2010, 07:21:18 am »
circular

your BGRABitmap is very good, but i can't use it becaus it is GPLed.

circular

  • Hero Member
  • *****
  • Posts: 3405
    • Personal webpage
Re: png alpha-transparency in linux
« Reply #8 on: April 12, 2010, 09:43:00 am »
See the other topic to continue talking about the license : TBitmap.ScanLine
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018