473,854 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Proper image format to use for Alpha images?

Hey all. The images I create in photoshop with semi-transparent pixels (for
instance in Photoshop text with a dropshadow with a transparent canvas) I've
been saving in PNG format and then using them in my VB.NET app using the
picturebox control. I was really happy when I learned that you could use
PNG images in VB.NET so your images could blend in with the form's
background color. But, is PNG the ideal image format to use with these
types of images? I don't know if there is some other format that is
recommended for Alpha images other than PNG.

No big deal, just curious. Thanks.

Andrew
Nov 20 '05 #1
18 7451
* "Andrew Christiansen" <no-spam> scripsit:
Hey all. The images I create in photoshop with semi-transparent pixels (for
instance in Photoshop text with a dropshadow with a transparent canvas) I've
been saving in PNG format and then using them in my VB.NET app using the
picturebox control. I was really happy when I learned that you could use
PNG images in VB.NET so your images could blend in with the form's
background color. But, is PNG the ideal image format to use with these
types of images? I don't know if there is some other format that is
recommended for Alpha images other than PNG.


Why not? If PNG fits your requirements, it's perfect. Personally, I
like the PNG format and prefer it to GIF or JPEG.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Why do you prefer it ?

Regards - OHM

Herfried K. Wagner [MVP] wrote:
* "Andrew Christiansen" <no-spam> scripsit:
Hey all. The images I create in photoshop with semi-transparent
pixels (for instance in Photoshop text with a dropshadow with a
transparent canvas) I've been saving in PNG format and then using
them in my VB.NET app using the picturebox control. I was really
happy when I learned that you could use PNG images in VB.NET so your
images could blend in with the form's background color. But, is PNG
the ideal image format to use with these types of images? I don't
know if there is some other format that is recommended for Alpha
images other than PNG.


Why not? If PNG fits your requirements, it's perfect. Personally, I
like the PNG format and prefer it to GIF or JPEG.


Regards - OHM# OneHandedMan{at }BTInternet{dot }com
Nov 20 '05 #3
* "One Handed Man [ OHM# ]" <OneHandedMan{a t}BTInternet{do t}com> scripsit:
Why do you prefer it ?


It's an open and very flexible format.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Im not that familiar with it, what are the basic differences, ( things you
can do with PNG ) that you cant with the JPEg for example ?

OHM

Herfried K. Wagner [MVP] wrote:
* "One Handed Man [ OHM# ]" <OneHandedMan{a t}BTInternet{do t}com>
scripsit:
Why do you prefer it ?


It's an open and very flexible format.


Regards - OHM# OneHandedMan{at }BTInternet{dot }com
Nov 20 '05 #5
Hey dont worry, PNG looks good.
http://www.aurigma.com/support/defau...ncoderInfo.htm
Andrew Christiansen wrote:
Hey all. The images I create in photoshop with semi-transparent
pixels (for instance in Photoshop text with a dropshadow with a
transparent canvas) I've been saving in PNG format and then using
them in my VB.NET app using the picturebox control. I was really
happy when I learned that you could use PNG images in VB.NET so your
images could blend in with the form's background color. But, is PNG
the ideal image format to use with these types of images? I don't
know if there is some other format that is recommended for Alpha
images other than PNG.

No big deal, just curious. Thanks.

Andrew


Regards - OHM# OneHandedMan{at }BTInternet{dot }com
Nov 20 '05 #6
Cor
Hi Herfried,

Serious, I also want to know that as OHM.

Because I thougth JPG has more posibilities in .Net
(I did not see much with encoding at PNG, but I can be wrong)

Cor
Nov 20 '05 #7
* "Cor" <no*@non.com> scripsit:
Serious, I also want to know that as OHM.

Because I thougth JPG has more posibilities in .Net
(I did not see much with encoding at PNG, but I can be wrong)


It depends on what you want to do...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
Cor
Hi Herfried,
It depends on what you want to do...


I forgot to reference by value to the message from OHM,
Im not that familiar with it, what are the basic differences, ( things you
can do with PNG ) that you cant with the JPEg for example ?


Cor


Nov 20 '05 #9
Hey everyone. Maybe I can clear up PNG format really quickly cause it seems
not a lot of people are taking advantage of PNG image support in VB.NET.
PNG has way more possibilities than JPEG, GIF, or BMP. The PNG format can
hold pixels that are semi-transparent (commonly called Alpha blending). For
instance in the JPEG, GIF, or BMP format, either a pixel is transparent (the
pixel behind the transparent pixel in the image is shown completely through)
or its not transparent (the pixel behind isn't visible at all). But, the
PNG format can have pixels that let the pixel behind it shine through
half-way on a scale 0 - 255 (0 being totally transparent, 255 being totally
opaque). VB.NET supports the PNG format, so you can create high quality
anti-aliased images with, for instance, drop shadows that blend in with your
form's background color, not matter what color it is.

To demonstrate, create a new Photoshop image that is 16x16 in size with a
transparent background. Create a new layer. Choose a solid red color (R:
255, G: 0, B: 0), and use the paint bucket to fill the new layer with the
color. Set the opacity of the new layer to 50% (that means all the pixels
in that layer let any pixels underneath it shine through it just half way).
Because there is nothing underneath that layer, you should see a slight
glimpse of the checkerboard through the solid red pixels (in Photoshop the
checkerboard symbolizes transparency). Now click File > Save As... > and
save as a PNG file. Create a VB.NET project and add a picturebox to the
form and load the PNG image into the picture box. Wow! Notice how the
BackColor of the picturebox is shining 50% through the solid red. Now
change the BackColor to a different color, see, it always blends 50% with
the solid red pixels. Now try saving as a JPEG and loading it into the
picture box, the 50% red pixels don't blend with the background color,
because JPEG doesn't support Alpha blending.

Whew. Tried my best to explain that as best I could, hopefully I didn't get
anything wrong. In my opinion everybody should use PNG images in their .NET
projects. Hope this helps anyone out.

Andrew
"Andrew Christiansen" <no-spam> wrote in message
news:OS******** ******@TK2MSFTN GP10.phx.gbl...
Hey all. The images I create in photoshop with semi-transparent pixels (for instance in Photoshop text with a dropshadow with a transparent canvas) I've been saving in PNG format and then using them in my VB.NET app using the
picturebox control. I was really happy when I learned that you could use
PNG images in VB.NET so your images could blend in with the form's
background color. But, is PNG the ideal image format to use with these
types of images? I don't know if there is some other format that is
recommended for Alpha images other than PNG.

No big deal, just curious. Thanks.

Andrew

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3875
by: Mr. x | last post by:
Hello, I would like that my image's background color will be transparent. What I have is only paintbrush. My image is *.jpg format (I have tried to save it as *.gif format, and I got less quality), and I don't know how to make the background. In every tool I open the image (html, flash, etc...) I see the original background color, and not the transparent color.
21
3086
by: DraguVaso | last post by:
Hi, I have an inherited DataGrid, that does lots of extra stuff. For exemple drawing a backgroundimage in every cell. The problem is that it's taking too much time (using gdi+), so I want to do it using DirectX. I downloaded already the DSK etc, but I can't find how I need to draw an image on a given position. I don't need stuff to write advanced 3D-games, just painting that image. Can anybody help me with this? I'm already looking for...
1
13221
by: Baramuse | last post by:
Hi, I wonder if it was possible to change the opacity of an image in a picturebox for example : I try to make a splash screen that shows up images (one after one). But i would like to change the opacity of the images as the program loads itself... like a progressbar.. And is there a way to make the image b&w too? Do I need a special library? thx
6
3991
by: felix | last post by:
Hi, I have an Image that is drawn with Graphics.DrawImage(..). What I want to do is drawing it with a given transparency, e.g. at an alpha of only 180 instead of 255. How am I doing that?!?!? Regards, Felix
1
4293
by: RicercatoreSbadato | last post by:
I have notice that my images have the value Image.Flags = 2 (HasAlpha). How Can I set the Flags to 1? I would like to eliminate the alpha channel... -- RicercatoreSbadato
5
1928
by: yxq | last post by:
Hello The icons with the alpha channel are supported in WindowsXP. If use the System.Drawing.Bitmap.ToBitmap on the icon handle(ico.ToBitmap), the alpha channel won't be preserved, resulting in an ugly black border where the alpha area. But if the icons with the alpha channel must be show in a picuturebox, how to do? Picturebox1.Image=??? The article http://www.vbaccelerator.com/home/NET/Code/Libraries/Shell_Projects/Getting_
1
1600
by: jitu78 | last post by:
GIF Images Use GIF files for images that have a small number of colors. GIF files are always reduced to no more than 256 unique colors. The compression algorithm for GIF files is less complex than for JPEG files, but when used on flat color images and text it produces very small file sizes. The GIF format is not suitable for photographic images or images with gradient colors. Because the GIF format has a limited number of colors, gradients...
2
3239
by: PJ6 | last post by:
I am rendering a few graphs with GDI+ and sending images to a web page. What image format is lightweight and the best for presenting line drawings sharply and without compression artifacts? GIF? PNG? JPG is too muddy, and BMP is too big. Paul
0
9901
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9751
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11025
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9513
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5743
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4159
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.