Wkhtmltopdf black and white pdf only - wkhtmltopdf

How can i generate a pdf with wkhtmltopdf which is only black and white?
I couldn't find anything in the docs https://wkhtmltopdf.org/usage/wkhtmltopdf.txt
By printing provided can only print the pdf as black and white, if there is no RGB color profile in it.

Related

Transparent Background - shows as black (convert pcx to png)

My goal is to convert a pcx image to png. The pcx image has transparent background and white lines\sketch.
I tried converting it using the below:
magick convert abc.pcx abc.png
magick convert abc.pcx -flatten abc.png
magick convert abc.pcx -background white -flatten abc.png
I also tried doing it programmatically (which is my ultimate goal) but nothing
using (var magickImage = new MagickImage(file))
{
magickImage.Format = MagickFormat.Png;
// this one kind of works, it does make the background
// transparent but the lines\sketch has white lines and black
// (only at the sketch)
// where we need transparent background and black lines\sketch
// magickImage.FloodFill(MagickColors.Transparent, 0, 0);
var filePng = Path.ChangeExtension(file, ".png");
magickImage.Write(filePng);
}
FYI - when the .pcx image is opened in adobe express shows correctly - transparent background with black lines.
When opened in ImageMagick (IMDisplay) shows black background with white lines.
Here is the link with the .pcx and the converted .png
https://drive.google.com/file/d/1x2fWswUFWL6hrLRCW1zuztC1Cry-QDqY/view?usp=sharing
Any ideas what i need to do?

Change all pixels of a particular color in an (animated) gif?

Change a color value of an animated gif : how to ?
I tried with Photoshop CC which allows changing colors of an individual palette, but does not allow changing the color in multiple layers. Only one layer at a tome.
And cannot find an option in Imagemagick as well.
A command like
convert ~/Pictures/animgif/3d\ polyhedra/4P4Q.gif -fill "#201940" -opaque "#000000" q.gif
does not work (#201940 is the color of the background which I want to change to black).
Looking up on the internet did not result in a solution.
convert ~/Pictures/animgif/3d\ polyhedra/4P4Q.gif -fill "#201940" -opaque "#000000" q.gif
I expect the backgroud color to be black.
You have your ImageMagick command syntax backwards. -fill is the new color and opaque is the old color. So
convert ~/Pictures/animgif/3d\ polyhedra/4P4Q.gif -fill "#000000" -opaque "#201940" q.gif
Thanks, that works !
I used imagemagick with a wrong command line.

Can not display a png image file which is modified from a svg file in MATLAB

I tried this code to modify svg image to png
filename = 'hello';
inkscapepath = '"my inkscape path"';
system( [inkscapepath ' ' filename ...
'.svg --export-area-drawing --export-png=' filename '.png'])
It will create a hello.png file.
If I open it with windows picture viewer it is looking fine.The same content is present.
svg image is in png form but resolution changed from 100x100px to 60x8.
But to view it in MATLAB if use
imshow('hello.png')
A fully black image is coming as output figure.
the image matrix contains all the entries equal to 0
This answer is based on a guess that the file only contains a black image on a transparent background
Such as this one:
-it's in a spoiler to show transparency
With imshow Matlab replaces transparent pixels with black, to avoid this we can use imread to load in the image with additional options to set transparent pixels to white and then use imshow
RGB = imread('hello.png', 'BackgroundColor', [1,1,1] );
imshow(RGB);
Figure from passing the filename to imshow
Figure from setting transparent pixels to white

How to print transparent images in Win32 (color key)

I am trying to print a transparent image in a Win32 application. The image has an alpha channel, but I could also live with a simple transparency mask.
When using the ::AlphaBlend method it is shown correctly on screen and gets printed correctly on my HP ColorSphere printer. However, with PDF printers (e.g. Primo PDF) the image appears opaque in the PDF.
When insertig the same image in Word, setting the transparency color to white, the image appears correctly transparent when using Primo PDF.
How should I draw my image so that the transparency also works in PDF printers? Or: how is Microsoft Word achieving this?
Thanks,
Fabian

stretching and a transparent background image in qt

The picture in png format with a resolution of 48x48 with white background. I need to get it stretched to the size of 16x16 and a white background was transparent. To display the image I am using the code:
QWidget* Icon;
QPixmap ico1(":/icons/ico1.png");
QPalette pal;
pal.setBrush(Icon->backgroundRole(), QBrush(ico1));
Icon->setPalette(pal);
Icon->resize(16,16);
Thanks.
for transparency use setWindowOpacity

Resources