-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Issue with --negate-colors Parameter Not Inverting Colors as Expected #435
Comments
Hi!
|
png_replace_color
rotated
My intention is not to invert the colors. The SVG file is colorless and I need to color the text part of the converted PNG, while leaving the other parts blank. I am currently writing a piece of code to achieve this conversion. |
Is there a way to set a fixed size when converting to PNG? Currently, it is a streamlined conversion, but generally, PNG requires a square shape, while the SVG is directly converted into a rectangle. |
Is there a way to support the background color function? The internal icon remains transparent, while the outer color can be set. The background can be a rounded rectangle, a regular rectangle, or a circle, and a radian parameter needs to be set. |
If you need multiple image manipulation features, you really should use a third-party library (PIL, ImageMagick…). CairoSVG is a SVG-to-raster-image converter, not an image manipulation library. |
Description:
Hello CairoSVG team,
I've encountered an issue where the --negate-colors or -n parameter is not functioning as intended when converting SVG files to PNG format. The documentation suggests that this parameter should replace every vector color with its complement, but it seems to have no effect on the output.
Steps to Reproduce:
Use the CairoSVG command with the --negate-colors flag: cairosvg input.svg -o output.png -n (240 / 255, 248 / 255, 255 / 255, 1)
Observe that the colors in the output PNG do not change as expected.
Expected Behavior:
The vector colors in the SVG should be replaced with their complements in the output PNG.
Actual Behavior:
The colors remain unchanged in the output PNG.
Environment:
I have tried to work around this issue by generating the PNG first and then processing the image with additional code to invert the colors. While this is a viable solution, it would be more efficient if the --negate-colors parameter could perform this task directly.
Code for Color Inversion Post-PNG Generation:
The text was updated successfully, but these errors were encountered: