RGB to CMYK Conversion and Mask/Crop - Photoshop - image

This may sound like stupid question, but for me it's important.
I don't have much experience with using Photoshop, because Inkscape is perfect for my needs (web). Now I would need to create something and print it. I know that color mode for printing should be CMYK.
Because I am more familiar with Inkscape(that does not support CMYK), can I create PDF in that program and then import it into Photoshop and change color mode to CMYK. Is that valid? It shows that color mode is changed, but is that all? Because this is not for me and I just want to know if person that I wouk this for will not have any problems when it comes to printing. How can I make sure that conversion to CMYK was good?
One more question. In Inkscape I can not crop image, but I can mask or clip it. Basically, image still exist, but you see only portion of it. When it comes to printing will printer print full image or just that portion of it or I will need to crop image?

For most part, when you print an RGB file on your printer, the printer will convert it to CMYK. It's ability to do so "well" will depend on how accurate you need it to be & what color profile it is printing from (sRGB generally turns out better than say AdobeRGB).
The main reason for you to convert a file is so that you can make any fine tune adjustments to the image after the change. So you're not leaving it to the printer to decide and possibly mess up.
I'm not familiar with InkScape so don't know how it'll export said artwork. When you open it in Photoshop however, you will be able to see if it tacked it on there. Then you can crop if need be.
Hope that helps.

Related

How can I Make a Steganographic Image

I want to make a steganographic image using some very simple software. I want to demonstrate the principle by opening up a bitmap image file in an editor that will let me see the binary that encodes the colours of individual pixels. I want to change the last couple of bits for some pixels to hide my secret binary message, then re-save the image. I have seen that there are a few applications available that can create steganographic images, some of which are free, but they seem to hide what is really going on. I want to see and edit the 'raw' binary for myself. I hoped something like Notepad++ or Cyberchef would let me do this, but apparently not. Can you suggest something I can use please?

Working with Images in Xamarin App programmig

I am working on a Xamarin App compatible with all devices. I have a general question related to images. I am using Location Mark Image Icons to provide locations available on the Map. My issue is, Image has a white background which is also showing along with its background. I want to show only the Image.
Is this related to the designer to provide the image without background? Or as a developer, I can do something on it.
Xamarin.Forms doesn't delete your white background. What you need to do is following a small tutorial on how to use Adobe Photoshop for example and export your images as png, you might even consider which png type you need, there's 3 types of png:
png8
png24
png32
I won't be going deep in explaining each one of them, but you need to know that they all support transparency and could have a transparent background, however, you might notice some differences between them on the edges.
For example, png8 will give a small white border while png24 will not show that.
You can check this for example: https://helpx.adobe.com/photoshop-elements/using/optimizing-images-png-24-format.html
No, you can't do anything about it using Xamarin.Forms. You need to modify the image and remove the background (using Adobe Photoshop, etc.) and make sure to save it as .png.
If its simple white background you want to remove, You can utilise simple [MakeTransparent][1] method ofBitMap.
But this will remove all white coloured pixel. So IF your logo also contains white color, better you contact your designer.

Matplotlib Plots Lose Transparency When Saving as .ps/.eps

I'm having an issue with attempting to save some plots with transparent ellipsoids on them if I attempt to save them with .ps/.eps extensions.
Here's the plot saved as a .png:
If I choose to save it as a .ps/.eps here is what it looks like:
How I got around this, was to use ImageMagick to convert the original png to a ps. The only problem is that the image in png format is about 90k, and it becomes just under 4M after conversion. This is not good since I have a lot of these images, and it will take too much time to compile my latex document. Does anyone have a solution to this?
The problem is that eps does not support transparencies natively.
There are few options:
rasterize the image and embed in a eps file (like #Molly suggests) or exporting to pdf and converting with some external tool (like gs) (which usually relies as well on rasterization)
'mimic' transparency, giving a colour that looks like the transparent one on a given background.
I discussed this for sure once on the matplotlib mailing list, and I got the suggestion to rasterize, which is not feasible as you get either pixellized or huge figures. And they don't scale very nicely when put into, e.g., a publication.
I personally use the second approach, and although not ideal, I found it good enough. I wrote a small python script that implements the algorithm from this SO post to obtain a solid RGB representation of a colour with a give transparency
EDIT
In the specific case of your plot try to use the zorder keyword to order the parts plotted. Try to use zorder=10 for the blue ellipse, zorder=11 for the green and zorder=12 for the hexbins.
This way the blue should be below everything, then the green ellipse and finally the hexbins. And the plot should be readable also with solid colors. And if you like the shades of blue and green that you have in png, you can try to play with mimic_alpha.py.
EDIT 2
If you are 100% sure that you have to use eps, there are a couple of workarounds that come to my mind (and that are definitely uglier than your plot):
Just draw the ellipse borders on top of the hexbins.
Get centre and amplitude of each hexagon, (possibly discard all zero bins) and make a scatter plot using the same colour map as in hexbin and adjusting the marker size and shape as you like. You might want to redraw the ellipses borders on top of that
Another alternative would be to save them to pdf
savefig('myfigure.pdf')
That works with pdflatex, if that was the reason why you needed to use eps and not svg.
You can rasterize the figure before saving it to preserve transparency in the eps file:
ax.set_rasterized(True)
plt.savefig('rasterized_fig.eps')
I had the same problem. To avoid rasterizing, you can save the image as a pdf and then run (on unixish systems at least) in a terminal:
pdftops -eps my.pdf my.eps
Which gives a .eps file as output.
I solved this by:
1) adding a set_rasterization_zorder(1) when defining the figure area:
fxsize=16
fysize=8
f = figure(num=None, figsize=(fxsize, fysize), dpi=180, facecolor='w',
edgecolor='k')
plt.subplots_adjust(
left = (18/25.4)/fxsize,
bottom = (13/25.4)/fysize,
right = 1 - (8/25.4)/fxsize,
top = 1 - (8/25.4)/fysize)
subplots_adjust(hspace=0,wspace=0.1)
#f.suptitle('An overall title', size=20)
gs0 = gridspec.GridSpec(1, 2)
gs11 = gridspec.GridSpecFromSubplotSpec(1, 1, subplot_spec=gs0[0])
ax110 = plt.Subplot(f, gs11[0,0])
f.add_subplot(ax110)
ax110.set_rasterization_zorder(1)
2) a zorder=0 in each alpha=anynumber in the plot:
ax110.scatter(xs1,ys1 , marker='o', color='gray' , s=1.5,zorder=0,alpha=0.3)#, label=label_bg)
and
3) finally a rasterized=True when saving:
P.savefig(str(PLOTFILENAME)+'.eps', rasterized=True)
Note that this may not work as expected with the transparent keyword to savefig because an RGBA colour with alpha<1 on transparent background will be rendered the same as the RGB colour with alpha=1.
As mentioned above, the best and easiest choice (if you do not want to loose resolution) is to rasterized the figure
f = plt.figure()
f.set_rasterized(True)
ax = f.add_subplot(111)
ax.set_rasterized(True)
f.savefig('figure_name.eps',rasterized=True,dpi=300)
This way, you can manage the size by dpi option as well. In fact, you can also play with the zorder below you want to apply the rasterization:
ax.set_rasterization_zorder(0)
Note: It is important to keep f.set_rasterized(True) when you use plt.subplot and plt.subplot2grid functions. Otherwise, label and tick area will not appear in the .eps file
My solution is to export the plot as .eps, load it up to Inkscape for example, then Ungroup the plot, select the object that I want to set the transparency and just edit the Opacity of the Fill in the "Fill and Stroke" tab.
You can save the file as .svg if you want to tweak it later, or export the image for a publication.
If you are writing the academic paper in latex, I would recommend you export the .pdf file rather than .eps. The .pdf format supports transparency perfectly and has good compression efficiency, and most importantly, can be easily edited in Adobe Illustrator.
If you wanna further edit the graph (NOT EDITING DATA! I MEAN, FOR GOOD-LOOKING), you could open the exported graph, in Adobe Acrobat - Edit - Copy elements into Adobe Illustrator. The two software can handle everything perfectly.
I work happily with this method. Everything clear, editable and small-size. Hope can help.

Mysterious PNG RGB+Alpha image that works with IE6

http://moztw.org/images/product-front-thunderbird.png
I am sure that this is a PNG image in RGB colors and a alpha channel (look at the shadow below the icon), but this file mysteriously works with IE6 w/o any special CSS hack (though it seems the alpha channel is being replaced by 2-bit mask in IE6).
Can anyone tell me exactly what information is in the file? It would be even better if someone could give a guidance on how to create such file. Thanks.
Edit: Friends at moztw.org added script hack to the website, so the above statement is no longer verifiable. But your are still welcome to investigate the image format.
That's PNG8+alpha. Explanation and examples in "PNG that works" article.
You can generate such files with pngquant (on a Mac, ImageAlpha is a GUI for it).

Blurred colors using epsfig or graphicx in LaTeX

My code is simple enough, and importing eps images is something I've done before with other matlab-generated content, but for one reason or another I end up with blurred colors in my heatmap when I use epsfig or graphicx to import it into my document. In the picture below, the right is what shows up if I compile to DVI and open up the document in Yap, and the left is if I simply view the eps in GSView.
alt text http://img85.imageshack.us/img85/1694/epsproblem.png
Here is my code. This example is using graphicx, but the idea is the same with epsfig.
\begin{figure}
\centering
\includegraphics[scale=0.5]{images/ngram3_model_raw.eps}
\caption{The perplexity when compared
against the HUB test set}
\end{figure}
Is there perhaps some option I am forgetting?
I had the same problem with DVI, but if I compiled to pdf the pictures were fine
What you see is bilinear interpolation. It is done by the viewer. Probably Matlab defines the plot contents as a pixmap (I guess you use imagesc?).
The solution is not straightforward. It may help to use a different processing chain (as WtFudgE pointed out) that will lead the data end up in a format where it is not interpolated anymore. You may also use a different viewer that does not interpolate and I would assume that a printer would also not interpolate. This can again be dependent of the application you print from.
Sorry that I don't have a solution for you; at least you now have some new words to search for in Google. ;)

Resources