OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18-11-2004, 08:43
dan
Guest
 
Posts: n/a
Default File Convertor to do transpararent TIFFs

After visiting the post:

http://www.oberonplace.com/forum/vie...t=transparency

I learned that background transparency was a property that could assigned during the export of a tiff file. I never knew that... but now that I do, I'm anxious to exploit this feature. I've got a software that allows for export of tiff images, but really only provides file size as an option that can be set. I often insert many of these tiffs into a MS powerpoint file and would very much like it if the background color in the tiffs didn't dominate the slide. Luckily, the background color is a solid color because it's output from a model so i don't have to go through the "flattening" procedure that i've also seen discussed in this forum.

I tried using Alex's file convertor macro to achieve the transparency and couldn't do it. I checked the box for transparency under in "advanced" window, checked the background color box at the bottom of the main screen, and then browsed to my RGB color after determining exactly what the color assignment was in photopaint. It created an output file, but the background color was the same. Is there more to the procedure than what i've already done?

I really like the batch convertor and want to use that in the short-term, but i think i would eventually like to do this step programmatically because the size of the image might vary and i would like to be able export to exactly the same resolution as the input file.

Any insights would be much appreciated.

Thanks,
Dan
Reply With Quote
  #2  
Old 18-11-2004, 09:41
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

The way to get transparency in a tiff is to add an alpha channel to it. You do this by adding a new color channel and filling the area that you don't want to show, with black and leave the "visible" areas white.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #3  
Old 24-11-2004, 11:26
dan
Guest
 
Posts: n/a
Default

So it's not as simple as doing a "color replacement?" I would have to manually draw in a polygon and then fill it with black? That would be a problem in that I've got potentially hundreds of images where the coverage of the color that i want to convert to transparent varies from image to image. Finally, it sounds like this is something that would have to be done in CorelPaint and not Draw. Is this correct?

Thanks,
Dan
Reply With Quote
  #4  
Old 24-11-2004, 11:47
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Dan,

Yes, if you have to have TIFFs, I would use Photo-Paint and its masking tools to create soft masks which then can be saved to the tiff.

However if you are concerned with inserting vector objects into PowerPoint, I would go to WMF/EMF format. You'll still have vectors and it should work well.

Also, you can use GIF/PNG formats and specify a particular color as transparent during export right from CorelDRAW. Here is an example on how you can do that: http://www.oberonplace.com/forum/vie...hp?p=1095#1095
Reply With Quote
  #5  
Old 24-11-2004, 12:33
dan
Guest
 
Posts: n/a
Default

Thanks Alex. I don't do much with CorelPaint, but I guess this would be a good time to start. I'll search the Paint forum to see if someone might already have put some code together for this application. Tiffs have to be my starting point because that is what my modeling software spits out (i can't really convert them to vectors and then insert to powerpoint). You're right though, I do a lot of work with windows and enhanced metafiles and they work pretty well in powerpoint. I've always assumed that I would lose either resolution or color depth if I converted my tiffs to GIF, but I've never actually tried it with these particular images. I'll see what a test looks like.
Reply With Quote
  #6  
Old 24-11-2004, 18:06
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Yes, that's true - you might loose some colors if you use GIFs. However PNG supports both color transparency and is capable of handling full RGB spectrum. You might want to give it a try.
Reply With Quote
  #7  
Old 29-11-2004, 07:56
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

Dan, also, see if your modeling program will output to Targa or .TGA format. This format allows you to keep anything that isn't part of the model (ie. atmosphere) as a mask and is exported as an extra color channel or some programs can export the transparency mask as a separate file.

I use 3D Studio Max quite often and I always use this feature for creating masks for overlays when I got to video.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #8  
Old 10-12-2004, 11:23
dan
Guest
 
Posts: n/a
Default

Alex, I just tried using your file convertor to convert my tiff files to PNG format. Problem Solved! Add another huge fan to your rapidly growing list. Not only does PNG accomplish exactly what I was hoping for with the tiff transparency mask, but it significantly decreases the file size with no apparent loss of resolution. The only thing I'm left wondering is how is this possible? Is there a webpage that compares/contrasts bitmap filetypes for dummies like me? I had never even heard of a PNG before.

Thanks,
Dan
Reply With Quote
  #9  
Old 22-12-2004, 14:23
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Dan,

PNG is a relatively new format which was created as an alternative to GIF after the scare of licensing fees to all the software using GIFs. TIFFs can also use compression, you might have just saved to a TIFF without a compression and PNG always has compression, that's why PNG was drastically smaller. However TIFF is (one of) the most flexible format(s). It can have pretty much anything in it, many different compression algorithms for making image smaller, both lossless and lossy ones, etc. It also supports a lot of various color models, starting from 1 bit black and white to 32 bit CMYK and even higher (16 bit/channel gray, RGB and CMYK). But PNG is restricted to 8 bit paletted and 24 bit RGB only.

In other words, PNG is perfectly suited for on-screen presentations (such as web) and TIF can be used pretty much anywhere. Too bad that web browsers do not support TIFFs (you'll need some kind of plug-in to view TIFFs in a browser - such as QuickTime,...)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
delete vba project from cdr file hotairballoon CorelDRAW/Corel DESIGNER VBA 1 18-05-2005 10:08
using "importfromfile" command without file name d olympiatr CorelDRAW/Corel DESIGNER VBA 3 14-08-2004 03:39
Finding a File in Sub Folders shelbym CorelDRAW/Corel DESIGNER VBA 10 10-05-2004 09:02
New macros: Oberon Selection Manager & File Name inserte Alex Site News 0 24-08-2003 13:28
Open - Resize - Savefile in Photo Paint greenee Corel Photo-Paint VBA 2 28-06-2003 04:54


All times are GMT -5. The time now is 07:39.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com