Ghostscript print driver to force cmyk instead of rgb? - printing

I'm not sure if this is even possible, but I'd like to know if Ghostscript could be used to create a print driver for an HP color laser printer to make it print cmyk instead of its native rgb profile?
If not, is there any other way to force an HP laser printer to print in cmyk?

Related

prevent black and white image auto convert to grayscale image

Start from ImageMagick 6.8, it will auto convert a black and white image(RGB) to be grayscale, which will make the altered image to be lighter than the original one. In ImageMagick 6.9, we can turn this feature off by using the command "-set colorspace:auto-grayscale=false". However, this option is not available in Wand latest version, is it a way I can turn off this feature by using Wand?
In addition, the command "-type truecolor" can also prevent Imagemagick convert the image to be grayscale. I try to set the image type to be "truecolor" by using "img.type = 'truecolor'" but the image is still converted to be grayscale, which is different behavior than the ImageMagick. Just want to know that is there something I did wrong or is there a way I can use to prevent black and white image to be converted into grayscale by using Wand?
In case anyone has the same issue.
You can use turn off auto-grayscale in wand.
with Image(filename='input.jpg') as img:
img.metadata['colorspace:auto-grayscale'] = 'false'

How to get a gold foil look using ImageMagick

My requirement is to convert a image with a transparent background to look like gold foil (the way it’s printed on leather etc.)
I've been using ImageMagick and am getting excellent results with certain kind of PNGs but not with others.
The Image Magick command I am using is:
composite foil.png tmp.png logog.png outputg.png
foil.png is just a gold foil image
tmp.png is a plain/empty transparent background png
logog.png is the logo with transparent background
outputg.png is the output (this is what I need)
However, this kind of result does not occur in most other images with transparent backgrounds.
Ex.
logom.png gives outputm.png which is all gold
logos.png gives outputs.png which is all gold and all wrong
Download all files as zip from here from here http://sdrv.ms/1h7QW4A or view from http://s.imgur.com/a/ExLRE
I checked the encodings of these all PNGs and they are all the same. What is wrong with logom and logos that the outputs are not as they should turn out to be?
If I am approaching the solution from the wrong direction, please suggest alternatives.

Converting a multi page pdf to multiple pages using a single command

I want to convert multi page pdfs into single page images efficiently.
I already know how to do this one page at a time with imagemagick. For example,
convert x.pdf[2] x3.jpg
will give me the 3rd page of the pdf as an image. So if I figure out how many pages are in the pdf using identify then I can loop through and convert all pages in the pdf to images. This method can however take a while. For example a 15 page pdf could take anywhere between 15-30 seconds.
According to answers that I have seen elsewhere (also on the imagemagick forums) the following imagemagick command should split a pdf into multiple images.
convert x.pdf x-%0d.jpg
but all this ends up doing is creating the first page named x-0.jpg
As an alternative I have tried using pdftk with the burst capability. The problem I faced there is that burst does not work in all cases. It does for some pdf's and does not for some others.
Any suggestions on how to improve things would help.
My OS is Mac OSX Lion but I do need this working on CentOS 6 as well.
You're missing the quantity of digits. Use:
convert x.pdf x-%04d.jpg
Where 4 means 4 digits will be show on the page count.
If you use Graphicsmagick on Debian or ImageMagick on macOS you probably have to add ADJOIN to your command.
So it should look like
convert x.pdf +adjoin x-%04d.jpg
When I tried to convert my multi-page pdf, the resulting image files had a gray background despite the pdf having a white background. (#John P commented on it on the accepted answer, but I couldn't get his comment to directly work for me.)
Here's what worked for me to make the background white:
convert -authenticate yourpassword -background white -alpha remove -alpha off -density 300 -quality 80 -verbose "Your file.pdf" "Your file.png"
My pdf had a password hence the authenticate.
You can see a summary of the options here:
-authenticate value decipher image with this password
-background color background color
-alpha on, activate, off, deactivate, set, opaque, copy", transparent, extract, background, or shape the alpha channel
-density geometry horizontal and vertical density of the image
-quality value JPEG/MIFF/PNG compression level
-verbose print detailed information about the image
More detail: https://imagemagick.org/script/convert.php
And the alpha remove option: http://www.imagemagick.org/Usage/masking/#alpha_remove
Ran into the same issue. Reinstall Imagemagick to work in Mountain Lion. If you use brew the simply
$brew unlink imagemagick
$brew install imagemagick

Converting TIFF Alpha Channel from Unassociated to Associated

For a dynamic imaging application I'm building, I have to take an image created by a rendering package and place it in an InDesign file. Because it needs to be CMYK with transparency, TIFF is the only possible format to use. The difficulty I'm having is that the renderer is generating an image with an unassociated alpha channel, which InDesign seems to have trouble understanding.
I'm working with the renderer manufacturer to see if they can change their output format, but in the mean time I would like to find some automated workflow to convert a CMYK TIFF with unassociated alpha to have associated (premultiplied) alpha.
I tried using GraphicsMagick's command-line tool (which would be easily scriptable), but the closest I could get simply forced the TIFF flag to get written as premultiplied--it didn't actually perform the premultiplication. The effect is a working alpha but with washed out color:
gm -convert <infile> -define tiff:alpha=associated <outfile>
Does anybody have other suggestions on how to achieve this conversion? My primary requirement is that it needs to be automatable in a Linux server environment, ideally via either scripting or a PHP library (since that's already being used elsewhere in the workflow), but I'm flexible on the PHP bit.
Edit:
For reference here are the two files (42MB each):
Original TIFF with unassociated alpha
Modified TIFF from GM with pseudo-associated alpha and washed out color

Taking a Screen Shot of an Embedded Linux Framebuffer

I'm running Embedded Linux on an evaluation kit (Zoom OMAP35x Torpedo Development Kit). The board has an LCD and I would like to be able to take screen shots convert them into a gif or png. I can get the raw data by doing the following: "cp /dev/fb0 screen.raw", but I am stumped on how to convert the image into a gif or png format.
I played around with convert from ImageMagick (example: "convert -depth 8 -size 240x320 rgb:./screen.raw -swap 0,2 -separate -combine screen.png"), but have been unable to get an image that looks right.
Does anyone know of any other tools that I could try out? Or does anyone have tips for using ImageMagick?
Take a look at fbgrab, an application that does just that (it saves the framebuffer content as a png).
You can simply capture the framebuffer to a file and open it in any raw image viewer or try online eg: https://rawpixels.net/
cat /dev/fb0 > fbdump
It might not be possible / easy to do it directly with ImageMagick.
The Linux kernel 4.2 documentation https://github.com/torvalds/linux/blob/v4.2/Documentation/fb/api.txt#45 says:
Pixels are stored in memory in hardware-dependent formats. Applications need
to be aware of the pixel storage format in order to write image data to the
frame buffer memory in the format expected by the hardware.
Formats are described by frame buffer types and visuals. Some visuals require
additional information, which are stored in the variable screen information
bits_per_pixel, grayscale, red, green, blue and transp fields.
Visuals describe how color information is encoded and assembled to create
macropixels. Types describe how macropixels are stored in memory. The following types and visuals are supported.
A list of visuals and types follows, but the description is not enough for me to understand the exact formats immediately.
But it seems likely that it might not be a format that ImageMagick will understand directly, or at least you'd have to find out the used format to decide the ImageMagick options.

Resources