I'm using the ML kit to read bar codes. When the background is white, the code is relatively easily read, but with a coloured background, red for instance, reading is very difficult, not to say it is impossible.
Does anyone know how I can read bar codes over coloured background in an easy way?
Related
Here a simple question I'd like to ask.
I'm making a videogame (with NO graphics) and for that I'm using SceneBuilder. So here is the state of my HP bar :
HP BAR
Now I want to reshape it in order to obtain a heartshape :
HP BAR wanted
Thus, anyone know if it's possible to do it using SceneBuilder with the settings?
Thank you everyone, have a wonderful day.
One simple way, providing the background of the panel is simple, would be to overlay an ImageView over the top of the progress bar. If you use a PNG with a "hole" of transparency, you'd effectively hide the areas of the square that you're not interested in seeing.
In this example, the black pixels would be the same colour as the background colour (in your case grey) and the white pixels would be fully transparent.
The downside to this is that if the panel changes colour then you'll need to recreate your PNG in the new colour.
I want to create Custom vertical progress bar with non linear background
In previous implementation I used skin composer , but as I know it works perfect with simple regular shapes (the knob part resize on the all background image so it looks bad in my example ). I also try to hack using several layer behind the progress bar, but for this case the background behind progress bar is transparent.
I suppose this solution can solve my issue but unfortunately I dont understand how can I implemented that solution.
I also try to crop the inside part (that reference), whenever the progress is changed but I dont think that is the best solution (also the increase/decrase animation cannot be simple enabled )
Could you draw the full red progress bar and then load peices of it until it fills up the whole thing?
Here is a way to get pixels from a png image and you could wirrite your own parser:
How do I read pixels from a PNG file?
Or you could search Google for how to get peices of a png or bitmap.
as a fun little project, I am trying to create an 'overlay' program.
Perhaps you've heard of the program 'open broadcaster software'.
This is a streaming program that can 'record' windows and apply 'color key' to them (making a certain color transparent)
I have a program that creates a window with a green background, acting as the greenscreen. On this window I want to make images appear, dissapear and move.
So far so good, however the problem comes with transparent images. They have a color hue over them because the color key tries to remove or smoothen out the colors.
So my question is; is there a way to programmatically add a color to a picture, or strengthen other colors, so color key would instead render the original?
Sincerely,
JB
Rendering a pertially translucent image on a backgroud showing the background color shining trough is the whole point of translucency.
There is nothing you can do without sacrificing the transparency in some way or another. A few useful effects can be achieved with java.awt.AlphaComposite, but I'm not sure any of the effects suit your fancy.
You could preprocess the images and change translucency to simple transparent/opaque (e.g. alter alpha for each pixel to newAlpha = oldAlpha < threshHold ? 0x00 : 0xFF). Selecting a good-looking threshhold value might be tricky (no one-size fits all). Needless to say that this will result in a drop in perceived image quality.
I have two pixel arrays, foreground and lighting. When I draw a white radial gradient (blurry circle) onto the lighting array, I want it to make the foreground visible - much like a torch in terraria/starbound. However, I also want to be able to mix different colors of lighting, rather than be stuck with black to white.
So how do I manipulate the pixel arrays so that they 'multiply' (I believe it's called)? Or is there an easier way using RGBA which I have not been able to get to work (flickering black on white or image getting ever more posterized)?
So far most responses regarding alpha channels / opacity have been using libraries from java which for this project I want to refrain from using.
Any help much appreciated!
If you want to know how the blending modes (such as "multiply") work in image editing programs on the pixel-value level, read this: How does photoshop blend two images together?.
Note that if you want to make the image lighter, you need a mode like "screen", because "multiply" makes it darker.
I'm writing an eclipse plugin, and I'm layering some simple figures (i.e. view elements) together to create diagrams.
A simple component looks like this
A simple component with rendering issues http://img115.yfrog.com/img115/4946/componentwithopacity.jpg
The drum icon on the right is part of a tiny widget drawer.
And the incomplete line underneath it is trying to represent multiplicity, but it's being blocked by the widget drawer.
I tried really hard to get a transparent background on the Figure, but the SWT colour class has no way to specify an alpha or transparent colour.
has anyone run into this problem before? How can I make my draw2d Figure background transparent so I can see stuff behind it.
This a small example of various other opacity related issues I've encountered. Solving this would fix a wide range of visual issues.
Any help is greatly appreciated.
CV
So IFigure.setOpaque(false) doesn't do it?
Simply set the alpha from 0 to 255 to your liking. See Graphics#setAlpha(int) during your paint event or see Shape - I think setAlpha(int) exists there too.