Is it possible to get screenshot in jpeg format with testcafe? - testing

I can't find anything about it in documentation. Can see the default type is png but is it possible to change to jpeg fx?

Related

stuck on basic image steganography in png (any more suggestion on what to do)

seems like theres something hidden in this image that i cant find.enter image description here
There should be a flag in there in the format GMC{}
I've tried photoshop, zsteg, steghide but still no luck
try looking at its exif data maybe you can find something there. There is a tool called exiftool that can be used to look exif data in a png file.

Is it possible to convert fabricjs svg output to pdf without rasterizing?

We are building a web app where the user can make a design by using fabric.js and at the end he should receive a pdf file with his work.
At first, we tried to use JSPDF because it was prefered to have a cliente-side solution. However by doing pdf.addImage(canvas.toDataURL(),...) we are rasterizing the design.
In second place, we tried server side solution using WKHTMLTOPDF, sending canvas.toSVG(), but there are some issues with fonts and shapes rendering.
The designs are complex as they can have text, shapes, images and svg.
We also tried INKSCAPE (inkscape --without-gui --export-pdf ...), MPDF and MUPDF without good results. IMAGEMAGICK is not a solution has it also rasterize the design.
The main goal is to get a vector pdf, where it's possible to increase size and where the elements of the design are selectable, and if possible that pdf should be ready to print (300 dpi and cmyk)
Yes its possible using TCPDF library.
Please check this ImageSVG api for more information for converting SVG to PDF.
https://tcpdf.org/examples/example_058/
Export the canvas to svg and use pdflib to make the pdf.
You can find an exemple here:https://www.pdflib.com/pdflib-cookbook/graphics/starter-svg/

pdf2svg leads to blurry images

I'm trying to convert a pdf figure to svg so I can edit some details with Inkscape. The problem I have is that the import changes slightly through some sort of smoothing.
In particular, this is the original figure:
And this is the figure after converting to SVG
This is the output of pdf2svg, which is exactly the same I get if I use Inkscape directly.
I attach a link where you can get both files.
https://www.dropbox.com/s/domxcc8pncyouy6/images.tar.gz?dl=0
Do you know a workaround to this issue?
Without seeing the SVG it is hard to tell for sure. However it looks like the "heat map" portion of your PDF/SVG may be a low resolution bitmap that is being enlarged in the page.
By default, SVG renderers will use interpolation when enlarging an image. This gives the image a smoothed/blurry look at large scales.
You could try locating the <image> element in your SVG and adding the attribute image-rendering="pixelated" to the <image> tag. Some browsers support that option and will scale the image using the nearest-neighbour scaling method.
Otherwise you may need to extract the image from the PDF or SVG; resample it at a higher (eg. 4x or 8x) resolution; then reinsert it back into the file.
Find the image in the SVG file (<image id="image5" .../>
Extract the Base64 encoded image from the DataURI. And decode it using a Base64 decoder.
Multiply the image resolution using an editor, cusch as Photoshop or Gimp.
Encode the file back to Base64
Update that <image> element with the new Base64.

PDFBox : Converting to image : Quality loss when converting PDF containing scanned documents

My use case is pretty simple. I need to convert the PDFs to images.I tried using apache pdfbox and i am having some trouble in converting pdfs which contains scanned images. when i convert scanned image the image clarity is lost due to compression/scaling. So i was trying to extract the image data from the PDF and then store it. But the problem is i may get PDF files which will contain images and text in which case i would need to fallback to image conversion mode. The problem is how to differentiate between the pages/documents having only image and the ones with composite data. I was thinking i could use ProcSet defenition for this purpose but looks like it is marked as obsolete and non-reliable according to PDF specifications. Other possibility is to check all the objects linked to that page and see if it contains anything other than images. Please let me know if there is an easier way of doing this
Thanks
If your intention is convert pdf to image, It is better to use ImageMagick for that. If you use ImageMagick, there is a lot options to change the quality of the image. And converting pdf to image is pretty simple using ImageMagick.

Magick++ - Reading JPEG2000 images

I'm trying to read JPEG2000 images in Magick++ (the C++ API of ImageMagick). To read an image I use the following code:
Image img("path/to/my/image.jp2");
But when I try to do this, ImageMagick throws an Exception and doesn´t load the image.
I extract the images out of PDF files. Could it be that something´s different to normal JPEG2000 images? To extract the images I read the stream of Image objects which have a JPXDecode-filter and save them to a file.
Hope someone can help me!
ImageMagick uses a package called JasPer to handle JPEG2000's. According to the wikipedia page on OpenJpeg, JasPer does not completely support the JPEG2000 specification. I have several extrected JPEG2000 that open fine in QuickTime, but fail to decode with ImageMagick.
I have had better results using OpenJpeg to decode the the Jpeg2000. The interface is less flexible, it will convert to PNG and BMP.