Question about creating images (RealDraw)
-
- KVRist
- 234 posts since 20 Mar, 2004 from Ontario, Canada
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!
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!
-
- KVRist
- Topic Starter
- 234 posts since 20 Mar, 2004 from Ontario, Canada
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.
-
- KVRist
- Topic Starter
- 234 posts since 20 Mar, 2004 from Ontario, Canada
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?
-
- KVRist
- Topic Starter
- 234 posts since 20 Mar, 2004 from Ontario, Canada
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.
-
LIMITAPROACHINGINFINITY LIMITAPROACHINGINFINITY https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=47871
- KVRAF
- 1850 posts since 13 Nov, 2004
I think gifs have transparency.
The following statement is true.
The previous statement is false.
The previous statement is false.
-
- KVRist
- Topic Starter
- 234 posts since 20 Mar, 2004 from Ontario, Canada
True - but the VSTGUI library is designed to handle bitmaps no problem. The rest - I'm not sure about.
-
- KVRian
- 922 posts since 26 Mar, 2003 from Guildford, England
-
- KVRist
- Topic Starter
- 234 posts since 20 Mar, 2004 from Ontario, Canada
oh - i suppose I should have read the docs more thoroughly!
i'm assuming you're talking about version 2.3 ?
i'm assuming you're talking about version 2.3 ?
-
- KVRian
- 922 posts since 26 Mar, 2003 from Guildford, England
nope.
you can have one colour of a bitmap transparent in the old version (see drawTransparent)
you can have one colour of a bitmap transparent in the old version (see drawTransparent)
-
- KVRist
- Topic Starter
- 234 posts since 20 Mar, 2004 from Ontario, Canada
-
- KVRist
- Topic Starter
- 234 posts since 20 Mar, 2004 from Ontario, Canada
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).
There is a setTransparency(bool) method - but I'm not quite sure how it relates (the documentation wasn't too helpful either).
-
- KVRian
- 922 posts since 26 Mar, 2003 from Guildford, England
-
- KVRian
- 1325 posts since 1 Sep, 2004
Bitmaps usually have no trancparency. The term is also very often confused by the people...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!
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.
