How to display a .bmp in an NSImageView for MacOs so that a certain color is transparent? - background-color

I have some .bmp files that have some color (maybe black) that is supposed to show as transparent when the graphic is displayed on top a form, so the form color comes through the transparent areas. But by default, when I put these images in an Image View, the black/transparent areas show up as BLACK!
I'm thinking I need to either:
- alter how the NSImageView shows the image, so that a certain color is transparent, or
- modify the .bmp files somehow to make that color suitable for transparency in an NSImageView
But I don't know enough about graphics files, transparency(alpha), NSImageView, nor the image editing tools. I'm trying to use Gimp, but...not sure what I'm doing yet. It seems like there is already a color that should be transparent in the current .bmp file.
I'm sure its something simple for setting NSImageView, or editing my file, or perhaps making a mask for the image, but I don't know how yet. I've looked at various filters in IB for NSImageView, but have not found where to set the transparent color, nor how to grab that color from the image file to make sure I use the correct value.
Thanks in advance for any assistance. (I tried to post some images, but because I'm new, I could not.)
Beau

I'm not a Cocoa developer, but in Gimp try adding an alpha channel to your image (a layer mask, perhaps) then saving as a 32-bit PNG image (with an alpha channel), then load that PNG directly into your NSImageView. If you want to make the black pixels transparent in Gimp use the magic-wand tool to select them (use magic-wand with 0 tolerance) and just delete the contents of the selection then save as a PNG directly.

Related

why does gnome automatically fills the symbolic icons in files

I try to design some icons for gnome (symbolic icons) but the problem is that gnome files make them completely black(it fills the transparent areas in the icons)
how i can solve this problem
Use SVG or PNG for the image file of the icon.
https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
Some other image formats don't support transparent white space. I recommend testing your icons in an image viewer that supports white space. If you get a similar effect, mind this is not in the editing program so what your seeing in the image decoding library making sense of the image, then you should try to change image format to a different format that supports transparent white space. If you are using Gnome, Eye of Gnome, the default image viewer, should show a gray checkered pattern where there is white space.

Changing only some path/group fills in a background image using svg-sprites

I'm using svg as a background image (logo) in a WP menu plugin and i want it to change a color (fill) when hovered. As it's a free version of the plugin i can't use image, object etc - i have to use my svg as a background image. I've to support IE (9+) so masks/filters are out of question and i'm pretty much left with svg-sprites. That's okey, i know how to do it (using use/xlink:href).
But now comes a tricky part. I want my svg to change only fills of some groups/paths while hovered leaving others untouched. I can only change colors of all paths/groups together in a background image with svg-sprites afaik. Is there a way to do it? Thank you in advance!

Coloured textures for POIs

I was trying to use a coloured texture (PNG 24/RGB) for a POI (bicycle_parking) and it was not being rendered. It was added properly as a texture, it just won't be rendered on the POI.
After some testing I came to believe that POIs only accept grayscale textures that can later be filled up with a color. Is this right?
I also found out that the icon needs to be of a specific size (I got it working only at 32x32 pixels and 512x512, but the scaling did not make it look good). Is there any information regarding this?
Now I have a grayscale icon (mostly white) but the fill color does not change the white as expected. This is as far as I got..
Here's a set of icons similar to the ones I need to render into POIs
How could I achieve adding this type of icons as the texture of a POI? Workarounds/hacks are welcome as well :)
Thanks!
The texture of the Poi must have a size that is a power of 2 and goes from 32x32 up until 512x512. Also make sure that the colour code of that image is RGB anything else wont work. For the best visual result you have to create 3 sets of pngs for different screen densities, for example see heatmap_legend.png then look at heatmap_legend#2x.png and heatmap_legend#3x.png, you can find them in the "common" folder.
So turns out that the color wasn't a problem after all. It was quite tricky to get one image working, but once I had the image working, adding color to it and saving the PNG worked just fine.
The problem with the image size I experienced is still happening. You need to export it in 32x32, 64x64 or 96x96 in order to StyleEditor not to crash when opening the file.

Transparent GIF image not transparent in web, has background

the img I made is suposed to be transparent but when I upload it to my web page it has a dark blueish background, just don't understand why .. please help, how can I check if its fully transparent ?
what browser? transparency in gif is just a color that you set as transparent and the browser must interpret it as transparent. Some older browsers don't work with it. If it displays correctly in any modern browser such as chrome for example, then the transparency is correctly set in your gif.
You can try another different software to save the GIF or a different method of selecting transparency, for example, by mask instead of by color. Or try a PNG format instead.

Pixlelated borders when i save image as GIF with Transparent In Illustrator

World Map Images in Adobe Illustrator CS5
I have an image Map in illustrator CS5 which i want to save in GIF so as to reduce its size for web use. But when i save it, the map boundaries are having some white pixels all along the map boundaries of map.
I really dont know why has happened to it, but cant save it in Png-8, png-24 formate due to size constraint.
Any meaningful answer will be highly appreciate and thanks in advance.
Is your background a non-changable color? Maybe you can save the image with the same color as a background.
The problem is gifs don't support true transparency.
If this doesn't work can you provide the image you are trying to save (gif and png, I don't have AI right now)? Maybe there will be something I can do about the size or clearing the gif's edges.
transparent GIFs don't have an 8-bit alpha channel, like PNG does: a pixel in a GIF is either there, or it's not: if it's there, you can't see through it. This often means that an edge between transparent and non-transparent areas looks blocky.
There are two ways to deal with this... either use a PNG 24 (and the Illustrator Save for Web feature will help you to make it smaller), or in Illustrator create a background color layer behind your image before you export to GIF. If this background color layer is the same as the website you put the image on, the edges will blend nicely.

Resources