Question about creating images (RealDraw)

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Thanks to whoever suggested using RealDraw. I find it very easy to use (so far).

But, I have one question:

Whenever I export a composition to a bitmap file, the original white-background rectangle always appears behind the image.

Does anyone know a way around this?

Thanks in advance!

Post

I guess what I'm trying to ask is to how to make the background of the bitmap transparent - so that even if it IS a white-rectangle, this won't be visible on my plugin.

Post

Ok, I figured out that you can use the "Export Crop" tool to crop what you want to save as a bitmap. This works great for rectangular images - but what if you want to crop a circle?

Post

bitmaps don't have transparency

unless i'm mistaken
Kick, punch, it's all in the mind.

Post

Yes - I guess that is the overall problem. I suppose the only way around that is to use .png because I believe it has the alpha channel.

Post

I think gifs have transparency.
The following statement is true.
The previous statement is false.

Post

True - but the VSTGUI library is designed to handle bitmaps no problem. The rest - I'm not sure about.

Post

later version of vstgui handles pngs

Post

oh - i suppose I should have read the docs more thoroughly!

i'm assuming you're talking about version 2.3 ?

Post

nope.

you can have one colour of a bitmap transparent in the old version (see drawTransparent)

Post

Oh!! Thanks for pointing that out!

Post

But what about the newer version? There is no "drawTranparent".

There is a setTransparency(bool) method - but I'm not quite sure how it relates (the documentation wasn't too helpful either).

Post

the only way to be sure is to look at the source code.

Post

jacksmash wrote:Thanks to whoever suggested using RealDraw. I find it very easy to use (so far).

But, I have one question:

Whenever I export a composition to a bitmap file, the original white-background rectangle always appears behind the image.

Does anyone know a way around this?

Thanks in advance!
Bitmaps usually have no trancparency. The term is also very often confused by the people...

There are two common kinds of transparency.
The one is "index transparency" wich is for instance possible with GIFs. But this is a quite old and bad quality mechanism. And it uses 256 raster (lossy) encoding.

This mechanism of index transparency can also be simulated wit "mask images" and work on usual bitmaps. The VST toolkit supports this already for a long time.

The other way is to use "alpha transparency".
PNG supports that native (like TIFF and others too). But only PNG has the best portability (it is an internet format too - as the name "Portable Network Graphics Interchange" implies) and additional support of highly lossless compression (which makes your resources fantastic small without any loss of quality).

This is far better than JPEG (format1), which is basicly lossy and don't support any transparency.

Technical: Alphatransparency includes a color value "A" for each pixel. So the format has (mostly) 32bit. Like "RGBA" for instance, where there is a byte value (0 to 255) for red, green, blue and alpha color information for every pixel in the image. So those four bytes result in - logically - 32 bit...

----

If you now want to export your alphatransparent pictures with RealDraw, so you have to do that in (32bit!) PNG format. (That's the alphatransparent format, not 24 bit - which has no transparency!)

Then use the latest VSTGUI framework and import the resources as a new resource with the foldername "PNG" (this is a required convention).

Then set the USE_PNG_ (or equally named) flag and compile your plugin. Don't forget to include the PNG framework, which is NOT a part of the VST SDK and must be downloaded elsewhere and connected to your code.

Finally, I want to point to the term "alphablend", which has basicly nothing to do with the kind alphatransparency above.
AlphaBlend simply compiles two more or less opaque images together (overlay), where the upper image is added (re-calculated) in a way, that makes it translucent (glassy). Alphablend also often is used internally in graphics applications, when overlaying several alphatransparent PNG images.


Thats all.

Post Reply

Return to “DSP and Plugin Development”