I want to be able to layer images(PNG) with blank space over other images and have the images underneath still partly visible. right now my Image loading function will prints black space where it should have the background image.
As Noah mentioned, if your PNG images don't have an alpha channel, you can use LÖVE's blend modes.
https://love2d.org/wiki/BlendMode
Try displaying your image with "premultiplied", for instance.
love.graphics.setBlendMode("premultiplied")
love.graphics.draw(myImage)
love.graphics.setBlendMode("alpha")
"alpha" being the default blend mode.
Related
I am using Lazarus.
I have put 2 images on a form and synchronized their positions and sizes.
I can textout to both images, and after I made the ontop image transparent I can see the combined content of both images.
I can add further text to the bottom image and see it, but I can't see text I try to add to the transparent image.
I used the following code to make the top image transparent
image2.picture.Bitmap.TransparentColor:=clWhite;
image2.transparent:=true;
I guess I need to play with the image bitmap, but I can't find a solution that is not using other software.
Can someone help me with this please?
i can't remove the white background when saving as png or jpeg.
tried everything what suggested me on the web, but still get the diminsions i set up as whitebackground.
How can i save image without the background?
see image below for settings.
enter image description here
if you want to remove all the white from the picture, better go to color range and sample white. layer via cut and delete the layer. and save it in png as #cybernatic.nomad said, supports transparency.
Make sure you have created your image on a new layer and delete (or hide) the first white layer. I just created a simple text on a new layer with a transparent background and then loaded the image back into Photoshop to confirm that it works properly. As per previous comment I use .png format to preserve transparency.
I know how to make NSStatusBarItem's image for both light and dark mode (by just setting the image as template, image.template = true). Also, to make the button have disable appearance, we can play with appearsDisabled property.
However, there is another interesting thing about NSStatusBarItem. I saw the NSStatusBarButton of Dropbox and Bluetooth have both inactive and active images on top of each other. You can try to pause Dropbox and you will see a pause image clearer than the Dropbox image. Also, when the Bluetooth is connected, you will see three-dots image on top of the Bluetooth image.
I have tried to put white and black colors for the image, even grayscale. But it turned out to be something different. I think it should be something to deal with 2 different images.
How can I have this kind of image on the status bar?
You can create this effect using different alpha values for pixels in the image. So for the example of dropbox in the paused state, the status bar item has an image where the pixels creating the paused icon are black and fully opaque, and the pixels creating the dropbox logo that appears gray are also black but with alpha 0.5
I am using PNG images as main image resource in my application. Since im using Delphi 7, i downloaded PNGImage lib and included it in project. I load images like this:
Form.image.Picture.LoadFromFile(PAnsiChar('\background.png'));
Image has transparent and semi transparent pixels on its border. The problem i get is that transparent pixels are filled with random zoomed part of my desktop with currently opened windows, while i expected to see what is actually located beneath form.
Additionally, form has this properties:
BorderStyle: bsNone;
TransparentColor: true;
Visible: false;
Here is a picture of current state (above black line) and desired:
Can this be fixed somehow or it is how delphi deals with transparency?
To have the form "shade" what's beneath it, use the forms AlphaBlend and AlphaBlendValue properties. The .png image doesn't have to be partially (alpha blended) transparent, but it can be.
If you want the form to be semi-transparent you use Alphablending, that's a limitation of Windows. In addition you can have a certain color fully transparent. In the following sample the forms color is clGray, which is also defined as the Transparent color property in addition to the Transparent property set to True. The image, aligned alClient, is 50% transparent, placed on a TImage which is set as transparent, but even so, it doesn't show up as semi-transparent unless you have AlphaBlending on. Again, this is a limitation of Windows. The best you can do is try with a fairly high value for AlphaBlendingValue (240..250) and a rather light image to find the right compromise.
I am trying to build a windows phone live tile. I want some text on the tile that is the accent colour. What this means is that I need to draw some text on the tile that is transparent. I don't seem to be able to write in the transparent colour.
I have a User Control which is 173 by 173 pixels which I save as a png file. I use this png as the image for the live tile. The transparent bits of the image come out in the current accent colour.
Any ideas how to write in the transparent colour in xaml?
This behaviour is to be expected. In your original question you are effectively saying "Write invisible text on top of the image", and that's what you're getting (imagine writing in invisible ink on a photograph). You effectively need to do one of two things.
1) Figure out which pixels are part of the text you're writing, and "remove" them from the image so the background colour shows through, or
2) Write text in the background colour ({StaticResource PhoneAccentBrush})
EDIT
You can probably achieve what you need using an Opacity Mask. Apologies for only providing that as a link as I haven't done this myself.