What will be the exact color if I am getting value 1 in "Separation" colorspace using itext7 pdf extraction? - itext7

I have been extracting pdf with itext7 and using textrenderinfo.getfillcolor() for fill color of text. I am getting colorspace as "Separation" colorspace and colorvalue as 1. How can I get this colorspace in rgb ?

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?

Wkhtmltopdf black and white pdf only

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.

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

Image processing - TIFF images in Matlab in grayscale

In Matlab, when I use
imshow('trees.tif')
it displays an RGB image, but when I use these two functions
I=imread('trees.tif')
imshow(I)
it displays a gray scale image, and it's still the exact same image.
This only happens with TIFF images, because when I use it for a JPEG image like so:
I=imread('flower.jpg')
imshow(I)
it displays an RGB image, and it's the same thing as imshow('flower.jpg').
Can anyone please explain why the use of imread/imshow on TIFF images displays them in gray scale?
Load the color map too:
[I,cmap] = imread('trees.tif');
Display it with the map:
imshow(I,cmap)
Convert it to RGB:
Irgb = ind2rgb(I,cmap)
So you can display and manipulate it without the colormap:
imshow(Irgb)
imagesc(Irgb)
% etc.
Eye candy:

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