Importing .png files leave black background?

chadrnator
chadrnator Website User Posts: 10

A complete Noob here guys, but was wondering how to import a .png file into hitfilm 4 pro to keep the file background transparent. I have googled everything and cannot find why the file is coming in with a black background. The closest thing I found was right clicking on the file in the media pool and changing the Alpha box, however there is no alpha box, only an aspect ratio box. I have tried all the alpha effects under effects but none of those work properly either. Any help would be greatly appreciated. Thanks

Comments

  • chadrnator
    chadrnator Website User Posts: 10

    I have used the luminance key to remove the black, but the image that I am using is white text with black outline, so by using this key it removes the black, but also removes the black outlines as well, frustrating.

     

  • AxelWilkinson
    AxelWilkinson Staff Administrator, Imerge Beta Tester, HitFilm Beta Tester Posts: 5,249 Staff

    Can you give us a link to the PNG file in question? In general, there isn't any special process required for this; you just import the PNG and the alpha is applied automatically.

  • chadrnator
    chadrnator Website User Posts: 10
    edited June 2016

    these are files on my pc is it possible to send one here?

  • chadrnator
    chadrnator Website User Posts: 10
    edited June 2016

    I will upload one to my google drive, then attach a link here.

  • chadrnator
    chadrnator Website User Posts: 10

    there are a couple of the files.....

  • chadrnator
    chadrnator Website User Posts: 10
    edited June 2016
  • Aladdin4d
    Aladdin4d Moderator Website User, Imerge Beta Tester Posts: 2,481 Enthusiast
    edited May 2016

    @chadrnator Try the ones marked as Transparent in this folder:

    https://www.dropbox.com/sh/dk1ovurx7uydnro/AAB3fedCrv2QTww2tv-Uog9Oa?dl=0

    The other two in that folder are your original files. My experience with your original files was mixed. Some things recognized the transparency. some things didn't and one program made everything black transparent. 

    My guess as to what's going on is the base background color was set to black when you made these and since you want a transparent background and a black border things are getting confused.

    EDIT: I guess should tell you how I got them to work in HitFilm! Oops........Chasys Draw IES opened your images with the transparency intact. "Save As" to PNG made images that are working correctly in everything I've tried. Chasys Draw is a pretty good alternative to Photoshop and it's free. 

  • chadrnator
    chadrnator Website User Posts: 10

    @Aladdin4d Yes, the files that you sent back titled transparent, worked. So basically I would need to make a .png with a different color background than black?

  • BobDiMarzio
    BobDiMarzio Website User Posts: 630 Just Starting Out
    edited June 2016

    Intriguing.    When I loaded the files into photo shop it said it was an index color type file.   So I went to:   Image->Mode  and changed it to RGB from index color re-saved it and it now has the transparent background.     

    If you cannot do this, just use demult in Hitffilm and demult will  render the background transparent. 

    Bob

  • chadrnator
    chadrnator Website User Posts: 10

    Yep! Demult worked perfectly. Thanks Guys!! Appreciate the help.

  • Aladdin4d
    Aladdin4d Moderator Website User, Imerge Beta Tester Posts: 2,481 Enthusiast
    edited June 2016

    Short length answer - Yes use a color other than black for the background color.

    Medium length answer - Use a background color that isn't used as a foreground color. If you aren't using black as a foreground color then black is fine as a background color. 

    Long explanation - In your PNG's (8 bit) transparency is basically a tag or flag that says a particular color is transparent. Transparent areas aren't defined pixel by pixel but by color only. The color is still actually there encoded in the file and it's up to the reading application to honor the transparency color value and make it transparent. If you've created something that doesn't have any background and everything is foreground then when you export to a PNG the transparency color value will usually default to whatever the project background color is set to or black or the application will give you the option to choose your transparent color during export. I can't say that covers every situation but one of the three will happen with most applications. 

    Most of the time that kind of behavior isn't a problem unless the transparent color is also used as a foreground color and needs to be opaque. When that happens you end up with a file that's saying a color must be transparent and opaque at the same time. Oops.  Different applications treat that situation differently. HitFilm obviously goes for making the color opaque but another program I tried made everything black transparent.

    Another way is to make explicit use of the application's alpha channel if it has one. A lot of image editing apps don't use a full alpha channel unless you specifically ask for it. When you do and use it to define transparency and selections when you export to PNG you'll end up with an RGBA PNG (32 bit) file that has a true alpha channel you can turn on or off via Properties in HitFilm and you'll have the ability to export just the alpha channel which is useful when working with HitFilm's Set Matte effect not to mention avoiding this problem completely. Explicit alpha channel usage is the reason I tried your files in Chasys Draw. All selection masks and transparency are always handled by a true alpha channel in Chasys Draw

  • Triem23
    Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 19,795 Ambassador

    Aladdin's answer is very thorough, but a quick couple of things he missed, or can be simplified.

    Seems that some of your PNG files were saved as "Indexed Color." In an Indexed Color situation you're reducing colors from a full-range palette to a limited number of colors--probably 256. In this case, yes, you'll need to define the transparent color, and, with a black outline it would have to be not black.

    Now, indexed color on a PNG is a bit silly. You're likely better off to save as a full RGB file with the full-range color palette. In this case the best thing to do is be all-foreground, no background, as other said. in this case (and you'll want to look for this if exporting PNG frames or sequences from Hitfilm itself) you're going to want to look for a menu or control that might be labeled "Bit Depth," or "Channel Mode," or something similar. For "bit-depth" you want to make certain you're exporting "32-bit," and for "channel mode," make certain you're outputting "RGBA." In Hitfilm it's "RGBA."

    So--when we start talking bit/color depth in CG it can get confusing. For example, Hitfilm can set up projects in "16-bit," which means "16 bits per color channel." Normal monitor RGB (final output) is going to be 8 bits per color channel--this means you have 256 values between black (0) and white (255). With 16-bits per color channel you have 65536 values between black (0) and white (65535). However FINAL DISPLAY IS 8 BIT/CHANNEL! The 16-bit calculations are just allowing a wider range of colors to be calculated before downsampled for display. It makes a difference in reducing banding issues. Think of if this way--in a 16-bit per color channel mode the computer has extra numbers to play with before "rounding down" for display. In an 8-bit mode you're pushing your values much more and it's easier to go out of your desired range.

    This is different from bit-depth on output. In this case the output encoder is assuming 8-bits per color channel (Side note--Open EXR is the exception. I'm talking AVI, QUicktime, MP4 and LPEG/PNG output). Which means the bit-depth given is a total bit depth. "24-bit" output is using three 8-bit channels, one each for Red, Green and Blue. "32-bit" output is using FOUR 8-bit channels, one each for Red, Green, Blue and ALPHA (transparency).

    As another quick note, an "Alpha" channel is a generic term. Alpha channels are any information stored outside of the RBG channels. In video we typically only use alpha channels for transparency, but, in tools like photoshop you can store as many alpha channels as you want. Typically each alpha channel will be used as a transparency mask, but, in Photoshop you can call up any alpha channel alone on in combination to store combined information.