Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong colors #55

Closed
kazuser opened this issue Apr 29, 2024 · 2 comments
Closed

Wrong colors #55

kazuser opened this issue Apr 29, 2024 · 2 comments

Comments

@kazuser
Copy link

kazuser commented Apr 29, 2024

Hi there!

<svg width="128" height="128" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="#fff" d="M0 0h128v128H0z"/></svg>
= 255, 255, 255

<svg width="2" height="2" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 .5h2M.5 0v2" stroke="#fff"/></svg>
= 254, 254, 254

0

Do you have any ideas how to fix it?

Source: Project1.zip
Original: EtheaDev/SVGIconImageList#273

@AngusJohnson
Copy link
Owner

program Img32_SVG_test;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  Classes, SysUtils,
  Img32,
  Img32.Fmt.SVG,
  Img32.Fmt.BMP;

var
  img: TImage32;
const
  svg_text = '<svg width="2" height="2" fill="none" '+
    'xmlns="http://www.w3.org/2000/svg">'+
    '<path d="M0 .5h2M.5 0v2" stroke="#FFF"/></svg>';
begin
  with TStringList.create do
  try
    text := svg_text;
    SaveToFile('test.svg');
  finally
    free;
  end;

  img := TImage32.Create;
  img.LoadFromFile('test.svg');
  Writeln(Format('$%8.8x', [img.Pixels[0]]));
  img.SaveToFile('test.bmp');
  img.Free;
end.

The console displays: $FEFFFFFF
This minute decrement in the alpha channel in this pixel is presumably because it's immediately adjacent to the image edge.
This isn't something I'm going to chase. Sorry.

@kazuser
Copy link
Author

kazuser commented Apr 30, 2024

As you say. Just wanted to let you know that your library does not work correctly with colors 🙄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants