Transparency filter

I lack software that lets me save images with transparency in them, so I have to code something that will give my images transparency. Currently what I'm doing is having the part of the image i want transparent to be magenta, then I have a code that changes all magenta pixels into transparent ones. Here's the code I did:
public Image filter(Image img) {
     BufferedImage b = new BufferedImage(img.getWidth(null),img.getHeight(null),BufferedImage.TYPE_INT_ARGB);
     int filt = new Color(255,0,255).getRGB();
     int repl = new Color(255,255,255,0).getRGB();
     b.createGraphics().drawImage(img,0,0,null);
     for (int y = 0;y < b.getHeight();y++) {
          for (int x = 0;x < b.getWidth();x++) {
               if (b.getRGB(x,y) == filt) {
                    b.setRGB(x,y,repl);
     return createImage(b.getSource());
}..this code works great, but just a tad slow. I remember seeing somewhere that someone used a different class to achieve this easier. Does anyone know what it is? If not, is there an easier way to do this?
Many thanks. :E

MS Paint (for Windows 2000 don't know about others, don't use) does support transparency.
Save the file as a GIF, then in
Image -> Attributes ( Ctrl-E )
use the "Transparency" & Select a colour for transparency.
Then download gif2png
then pngcrush
Or, if you have a lesser version of paint, download bmp2png
convert bmp to png, open in Microsoft Photo Editor, use the "Select Transparency Colour" toolbar button, click on the colour you want transparent, save, pngcrush.
Or finally write a quick Java app, I'm guessing untested, save as png/gif (using on of the methods above) then:
import java.net.*;
import java.io.*;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
public class Test {
  public void main(String argv[] ){
       try {
         OutputStream outputStream = FileOutputStream( argv[1] );
         URL url = new URL( argv[0] );
         InputStream is = url.openStream();
         BufferedImage bimg = ImageIO.read( is );
            for( int x = 0; y < getHeight(); x ++ ) {
               for( int y = 0; y < getWidth(); y ++ ) {
                  if( bimg.getRGB(x, y ) == 0xFFFFFF ) { // White pix
                       bimg.setRGB( x, y, 0xFFFFFFFF ); // white,
                                                        // full aplha
         ImageIO.write(bimg , "png", outputStream);
     }catch(Throwable t) { 
           System.err.println( t );
}All the paint applications you need.

Similar Messages

  • CSS transparancy filter

    I'm using the following CSS to create a transparent effect:
    /* This is the transparent box for the foot */
    #foot {
    font-size: 10px;
    background-color: #ffffff;
    filter:alpha(opacity=75);
    opacity: 0.75;
    -moz-opacity:0.75;
    text-align: center;
    width: 225px;
    clear: right;
    margin-right: auto;
    margin-left: auto;
    /* This is the container which set text to solid color for
    foot.
    position: relative used for IE */
    #foot div {
    color: #000000;
    filter:alpha(opacity=100);
    opacity: 1;
    -moz-opacity:1;
    position: relative;
    padding-top: 10px;
    This works great in IE but only partially in FF and Safari.
    <div id="foot">
    container is transparent but the <div> inclosed by it
    inherits the 75%
    alpha. The div does not have the 100% specified in the #foot
    div style.
    Here is the HTML
    <div id="foot"> <!--start foot -->
    <div>Copy Copy Copy</div>
    </div> <!--end foot -->
    Like I said this works great In IE is there a fix for FF and
    Safari?
    Jeff

    You can see it here:
    http://www.margaretgordon.net/new/
    In FF and safari the background is transparent but the copy
    does not return
    to 100% alpha.
    So FF does recogonize the CSS but not my code to override it.
    Of course IE does just what I ask.
    Is there something I'm missing in the override CSS:
    /* This is the container which set text to solid color for
    foot.
    position: relative used for IE */
    #foot div {
    color: #000000;
    filter:alpha(opacity=100);
    opacity: 1;
    -moz-opacity:1;
    position: relative;
    padding-top: 10px;
    Please help if you can.
    Jeff
    "BruceCSI2" <[email protected]> wrote in
    message
    news:f0j5ah$fu$[email protected]..
    > This may be similar to the colored scrollbars, in which
    they only work in
    > IE, not other browsers.

  • Transparent Filter Lists (Column Headings IR)

    All,
    I currently have the issue where the filter drop down lists appear transparent in my interactive reports. It is very difficult to read the list as it merges with the report data behind it.
    I have found the fix in a previous thread but I am having trouble getting it to work.
    Can any one tell me exactly where I should paste the below CSS tag?
    +<style type="text/css">+
    +.dhtmlSubMenu {+
    background-color:#fff;
    +}+
    +</style>+
    Version: 4.0.1
    Theme 13
    I am using IE8
    Thanks

    The Page Header (or the Page Template Header) is the right spot.
    If you use Firefox with Firebug installed, do you see any errors? If you inspect that element (in Firebug) you can see if your css style is applied to that object. Might be very helpful to track down what's happening.
    Or setup a tiny example on apex.oracle.com and "the world" can actually see what's happening and help you out!
    I looked into it. As I see it the looks from the Filter drop down list comes from this piece of CSS:
    #apexir_columnsearch, #apexir_col_values_drop, #apexir_rollover {
    -moz-box-shadow:2px 2px 4px #888888;
    background:url("../apex/builder/1px-white-trans.png") repeat scroll 0 0 transparent;
    border:1px solid #AAAAAA;
    font-size:11px;
    overflow:hidden;
    position:absolute;
    width:200px;
    z-index:1000;
    So the background:url piece does the trick. You have to override that by adding your own style. Seems to have nothing to do with the dhtml... thing.
    (btw: I have no trouble with this looks at all, I can see the data fine in FF, Chrome and Safari)
    Edited by: Roel on Oct 22, 2010 2:54 PM

  • Vector vs bitmap, gradient/transparency/filter performance questions on ios

    so i understand vector artwork is all done by cpu and drawn every frame and bitmaps can be loaded directly from ram using the gpu but when you have simple objects such a masks and static lines, is it more efficient to use vector graphics for a mask? or should it be a bitmap?   what about a line, since it is just a graphic made using a equation rather then wasting resources on a large picture?
    also when movieclips have filters on them such as bluring, it seems like it overlays multiple transparent copies of the image onto the selected movieclip. Does the cpu then have to multiply each colour of the transparent images to arive at the final blur? when i cache this as a bitmap and the edges are feathered/transparent does the gpu multiply the transparercies at the edges? or is it still the cpu that handles it?
    I also wanted to know how stressing gradients are on the cpu/gpu, as a bitmap i assume it is treated the same as any other image but as a vector is it more costley on the cpu to have it up on the stage than an image?
    if there is any tips for graphics on mobile devices i would love to hear them.

    so i understand vector artwork is all done by cpu and drawn every frame and bitmaps can be loaded directly from ram using the gpu but when you have simple objects such a masks and static lines, is it more efficient to use vector graphics for a mask? or should it be a bitmap?   what about a line, since it is just a graphic made using a equation rather then wasting resources on a large picture?
    also when movieclips have filters on them such as bluring, it seems like it overlays multiple transparent copies of the image onto the selected movieclip. Does the cpu then have to multiply each colour of the transparent images to arive at the final blur? when i cache this as a bitmap and the edges are feathered/transparent does the gpu multiply the transparercies at the edges? or is it still the cpu that handles it?
    I also wanted to know how stressing gradients are on the cpu/gpu, as a bitmap i assume it is treated the same as any other image but as a vector is it more costley on the cpu to have it up on the stage than an image?
    if there is any tips for graphics on mobile devices i would love to hear them.

  • Using a fake semi-transparency - what's really possible?

    Hi,
      I'm just now moving into DW CS4 (from cs3) and I'm on an intel iMac. I'm trying to make a table background that is semi-transparent while KEEPING text and photos 100% opaque. I'm already familiar with this kind of code: (just improvising here):
    .tableMain {
    background: transparent;
    filter=alpha(opacity=50);
    opacity=.5
    But this makes EVERYTHING semi-transparent - content and all. I'd love to know if it is possible to keep the content fully in view.
    I've tried making a semi-transparent GIF or PNG background in Photoshop CS4 and using it for the table background, but that doesn't seem to work.
    I did discover this (perhaps unique to my site) solution for a fake semi-transparency: Since I've got a gradient background on my site (see www.frankbright.com/History.htm ), I took a 'Screen Snapshot' of the background, from the bottom of the navigation to as far down as I could go. Then I used PS CS4 to expand the canvas and color down to cover my long pages. (See Jazz Links)
    Then I used PS levels to darken the snapshot very slightly, so as to intimate a gray semi-transparent effect. Then I simply used that snapshot as the table background.
    This looks better on the long, clearer pages that have only text content. With the index3 home page, however,  you don't sense the semi-transparent effect I'm going for as much.
    I've also noticed the 'Extensions' area of the CSS interface in DW - does this have anything to do with what I'm trying to do?
    Anyways, I'm open to ideas, if anyone could suggest any.
    Many Thanks, Frank B.

    Hi
    You did not say what the problem was.
    others viewing this thread. please read -
    As for the colors of the background gradient using IEFilters, (for those who did not know on the forum, the IEFilter for background gradient was available since IE4.5, circa 1996, and all filters since IE5, circa 1998) you will need to adjust these as required. Luckily enough most background gradients go from one color to white or a lighter color of the starting color.
    For FF and Safari see - http://hacks.mozilla.org/2009/11/css-gradients-firefox-36/, http://webkit.org/blog/175/introducing-css-gradients/.
    Google Chrome uses the webkit declaration, but unfortunately Opera does not support the feature, (use a standard background color at the beginning of the declaration) and FF only from version 3.6. But with the upgrading for FF users normally being 70+% within 6 months, this does mean that 85% of users will support the background gradient.
    PZ
    Edit: If you are using a css reset then it may be worth placing the position: relative; statement in this, as these normally include all the elements from H1 to pre.
    Message was edited by: pziecina

  • Converted outlined text not distilling properly

    I'm not sure if this is an Illustrator issue or an Acrobat distiller plug-in issue or even a font, if someone can shed some light I would be so grateful.
    I'm using the Mac CS3 design standard suite and the type family I'm using is Avenir on my MacBook Pro at home and a CS2 on a PC at work and the same issue happens on both platforms.
    My newspaper only wants ads that are saved is a press optimized pdf with all type made into outlines.
    When I view the text conversion in Illustrator's preview mode, all the text look accurate; all the I's and L's are outlined rectangles.
    When I save the file as a pdf, with the press optimized setting and then view it in Acrobat, the I's and L's looks strange. When print to my proofing laser the kerning between the any i or l character is increased.
    I will open this pdf in Illustrator and turn on the preview mode, Inotice that the I's and L's are no longer outlines but are now are two points (a vector stroke).
    Any users out there have a solution other then manually creating I's and L's with the rectangle tool?

    I outline text by highlighting the text and then select the Create Outline command under the Type pull-down menu. Never thought of flattening - the document only had two text blocks on one layer on top of a layer that had a placed tif image and a logo (that was completely vector art); I usually only use the flattening command when I use the transparency filter.
    Thanks for the tip Wade, I'll try the Flattening with outline stroke checked first and see if that works.

  • Browser player doesn't display my site as it is built in Flash?

    I"m using FlashCS3 I am developing a site. When I run the swf file using "test movie" or even by going to the folder containing the .swf file and not through the Flash program it plays perfectly as I want it look. But when I upload it to the site and hit it with my browser it doesn't display the same way???
    In fact the browser shoes a background that I replaced with the partially transparent filter effect you see when played locally??   I have looked all through my movie clips and can not find where i tcould insert the old background?
    I have made some snaps of what it looks like when played through the player outside of the flash editor (but this is the same as when played through the editor) and another pic of what it looks like on the web.
    I am using Actionscript 2.0 mode for publishing, Flash player 8 or better, Bottom Up with compress movie and export hidden layers checked.

    ok i found the solution here by deleting the corrupted library
    http://portablevideo.blogspot.com/2008/12/music-player-database-problems.html 
    now one of these below is for the music and one for the photos and i didnt have a problem with the photos but did it anyways and now the player can see my music:
    these are the files that need deleting in order to get rid of the corrupted library.
    Storage Drives: (Mass storage E, Memory Card F)
    \private\101ffca9\harvesterdbvx_x.dat
    \private\10281e17\[string]mpxvx_x.db
    \private\10281e17\[string]pcvx_x.db 
    TIP: Connect the device in USB mass storage mode (File Transfer), to locate the private folder from the PC.
    TIP: STRING and x_x will change depending on your phone. (my files had slightly different names than above on the n97)

  • New/Updated free plugins for FCE

    A couple of new plugins are available for free in my Final Cut Express/Pro Effects and others have been improved in their use of alpha channel, composition methods, and precision in object sizing (both new and updated plugins have a NEW flag in my welcome page).
    In addition I added a set of (well so far only 3) plugins I labeled "toolbox": they do not really help in editing, but help in understanding how editing works:
    - Channels displays selected color channels (either RGB or YUV) including alpha channel
    - +Field Selector+ displays selected fields of each frame (either field 1 or 2 or both... side by side): it turned out to be a very valuable fxscript debugging tool
    - +Value Tester+ displays values of selected fxscript variables: quite cryptic for non fxscript programmers...
    Among the "standard" plugins a new entry exists: +Make Transparent+. This is quite simple and useful when applied to the masks made available by FCE (e.g. the generators in the Render or the Shapes bin).
    +Make Transparent+ simply changes the white areas in the selected mask into transparent areas and black areas into opaque areas (or viceversa). The mask with the Make Transparent filter now may be simply superimposed to the clip... see the examples in my web page.
    I hope these are also useful to my friends in this forum.
    I'll be glad to read comments and suggestions...
    Piero

    Thank you for making your hard work freely available to us.
    Ross Hunter
    Orange, VA

  • Drop Shadows | Again?

    I know this has been disussed here on numerous occasions but
    can someone tell me which method is being used on this website's
    drop downs? How is the opacity achieved over the content below?
    Adobe trade secret??
    Rich

    > No url posted so just guessing.
    I think OP meant Adobe's site, used "this" and
    >Adobe trade secret??
    They're on the web forum.
    Jo
    "Nancy O" <[email protected]> wrote in message
    news:fs1d95$928$[email protected]..
    > No url posted so just guessing.
    >
    > CSS
    >
    > .transparent {
    > filter:alpha(opacity=50);
    > -moz-opacity:0.5;
    > -khtml-opacity: 0.5;
    > opacity: 0.5}
    >
    > Html
    >
    > <div class="transparent">
    > <p>your 50% opaque content here</p>
    > </div>
    >
    >
    > --Nancy O.
    > Alt-Web Design & Publishing
    > www.alt-web.com
    >
    >
    >
    >
    > "RICH POW" <[email protected]> wrote in
    message
    > news:fs1b4u$72l$[email protected]..
    >> I know this has been disussed here on numerous
    occasions but can someone
    > tell
    >> me which method is being used on this website's drop
    downs? How is the
    > opacity
    >> achieved over the content below?
    >>
    >> Adobe trade secret??
    >>
    >> Rich
    >>
    >>
    >>
    >>
    >
    >

  • Children's Laptop Software

    My kids have had a laptop for a while but up to now they have been happy using the bookmarks I have set up to go to the likes of CBBC, CITV, Etc. However, now my eldest is getting better at reading, writing and spelling I'm starting to get concerned about stuff he might come across on the web. We try where ever possible to be with him when he's surfing anyway so we can keep an eye on things but it's just not possible to be able to be there 100% of the time.
    I've been looking at this Parental Controls and wondered if anyone has any experience of this or an alternative they can suggest?

    Welcome to  Discussions!
    If the laptop is only used by your children, you can use a variety of methods to filter content coming into the computer via the browser being used. If it only has Safari this could be very simple, but can still be done with any browser. The link you provide is for a keylogger, which doesn't actively block access to sites, it is meant to record what's been done on a computer. If you want to protect before the fact, there are programs to filter content like Net Nanny. Such software is more likely to be obvious to the users (your children) and thus more likely to be found and possibly attempted to be overcome. It is also not free, but is going to be quite simple to use.
    A more advanced option could be a PAC file which would prevent access to undesirable sites at deeper and more user transparent level. There's a good pre-made PAC file available from HostsFile.org called King of the PAC, and there's a link for the UNIX version you should use on your Mac. Using a PAC file would require more time and care on your part to set up, but is free and will more deeply, effectively, and transparently filter content.

  • Keyboard Backlighting Problem

    Hello,
    Recently, if i use the f5 or f6 keys to raise or lower the level of illumination on my laptops keyboard, the semi-transparent window comes up with the horizontal bar and the blocks to indicate brightness level, but has a O with a slash through it underneath the row of blocks, and neither keys have any effect.
    I went to system preferences, enabled "illuminate keyboard in low light conditions" and it lit right up. I then tried to use the keys once it was already lit in this manner, and they functioned RIGHT until I uncovered the iSight camera (I covered it to cut off all light).
    Any help?
    Thanks in advance, and Happy Holidays!

    Just to add to eww's observations, it seems to me that the location of the sensor in the upper bezel next to the iSight camera adds to the problems quite a bit. I find myself that the light falling on this point can be quite different from that falling on the keyboard itself. Simply changing the angle of the screen, or altering ones sitting position can produce substantial variations in the behaviour of the backlight. We have high "clerestory" windows in our house for example, and if I sit with my back to them the light hitting the light sensor can be far greater than the light falling on the keyboard itself.
    I can see pluses in the location , too, especially on a small keyboard like the 13" one where ones hands would be likely to interefere with illumination levels, but by and large I think the location on the early MBPs under the speaker grids on either side of the keyboard was superior.
    Maybe rather than using "blackout" tape, some sort of semi transparent filter material over the sensor would be an option?
    Cheers
    Rod

  • Multiple Image Masks

    How do I create three individual image masks on three separate videos (which I know how to do) and then be able to move the videos behind the masks without the masks themselves moving?...
    ...all I have used to date is the Image Mask filter with a white rectangle covering 1/3 of the screen...should I be using a different filter or effect?...

    ...my intent is to specify exactly where a clip will be shown having the screen split with different camera angles, while at the same time showing only a portion of the original clip, and being able to motion the video behind the 'mask' without the mask moving...
    That's exactly why I suggested the use of masks that are separate clips and of the Make Transparent filter... I suggest you to check the filters instructions and to try it yourself. In any case it's quite simple to use:
    - drag the mask clip (either a generator or an imported custom greyscale still) into the timeline on any track above your clip to be masked - now the mask completely hides the clip below
    - drag the Make Transparent filter over the mask clip in the timeline: now the white areas of the mask will become transparent and will show the clip below (look at the canvas to see the result)
    - apply any motion, cropping, distortion, etc. to your clip below the mask and the mask will not be affected.
    Note that if you want 3 clips together on screen you have to repeat the above steps for each clip: at the end you'll have 3 clips, each with its own mask on top, stacked in 6 tracks of the timeline: the tricky part now is to change the Center, Scale and/or Crop for each clip and its own mask in order to lay them out in the frame as you need. But each clip may have a different mask shape and be modified without affecting its own mask.
    Let me know if it works
    Piero

  • Problem with "Noise dissolve" filter Motion 1.0.1/ psd transparency

    Hello,
    sorry for my english but i'm writing from france...
    So, this is my problem. If you want, try the same thing and you will see something ugly :
    this is an example (not real files that i'm working on) :
    I import a photoshop file with two layers in Motion. Layer 1 is just a pink color. Layer 2 is a copy of small portion of Layer 1 ( so it's the same color : pink ). I make this copy with a progressive border/selection of 2px (soft edge of 2px).
    In motion layer 1 is under layer 2. Of course layer 2 have a transparency, because it's just a copy of small portion of layer 1.
    When you look at the image, you just see pink color ( in fact there's two layer of the same color ). This is before applying the "noise dissolve" filter.
    I apply the "noise dissolve" filter on layer 2 to make this layer appear in 300 frames. At frame 0 layer 2 is hidden by effect, at frame 300 the effect reveal the layer 2 with animated pixels (this is the "noise dissolve" effect). Of course, once again you don't see layer 2 appear because it's the same color than layer 1.
    BUT...
    when layer 2 "appear", i can see a black (and ugly) border around the layer 2!
    It seems that Motion make a soft border around a transparency object !
    Maybe i don't understand something ? I try to change the settings of the alpha channel in the inspector when i'm selecting my imported image, but it doesn't change anything!
    I try to make a progressive border/selection/soft edge of 0px ( it's like a hard edge i think ) on the layer 2 in photoshop. In Motion, it's better but i can see the black and ugly border again ( not so visible, but visible anyway).
    Here is a capture of what i see with the effect applied (On left you have hard edge, on right soft edge.):
    http://perso.wanadoo.fr/elzef/motion.jpg
    I hope you understand what i mean...
    Somebody know about this problem ?
    Thank you
    G5 2x2 Mac OS X (10.3.9) Motion 1.0.1
    G4 MDD Dual 867 Mac OS X (10.3.9) and 9.2.2
    G4 MDD Dual 867   Mac OS X (10.3.9)   and 9.2.2

    Hi Patrick,
    thank you,
    i set layer 2's alpha to pre-multiplied:
    at the begining it's seems to be OK,
    but at the middle of the effect the noise appears as white pixels, then disappear when come to the end.
    At the end the soft border is not visible ( that's waht i want for the end) but the hard edge still visible - not so visible whan it was black, but still here.
    I try to set layer2 alpha to "behind". It seems to work with the soft edge but don't work with the hard edge.
    I will try again with the images of my real project and try to not use hard edge, maybe it's gonna work.
    Thank you very much
    elzef (France)

  • Liquify Filter causing semi-transparent layers to become brightened

    Hi,
    I'm having an issue with the Liquify Filter's final results. When using the filter it works fine, and if I use the filter on a solid layer its results given back to the original image are perfect also.
    However, using the filter on a layer that has mostly transparency behind it (a layer with sketched line-art on it for example), the result given back to the original image is brightened significantly. The only work-around I have found so far is to merge a solid colour background to the transparent layer, and then the result works fine. However this is not desirable because future use of the image as line-art requires editing to get it back onto its own layer that can be destructive when the work contains tonning.
    Is there any fix for this?
    Thanks,
    - Ricky

    I have encountered the same problem with brightening of mostly transparent layers when using Liquify.
    I'm using the latest version of Photoshop-CS6 on an HP Pavillion p6 series that came installed with Windows 8.

  • How to handle transparent parts of layers in filter plugin?

    What is the right way to handle layers in a filter plugin so as to preserve the colors at the semi-transparent edges of the opaque parts of a layer?
    It seems the inData my plugin gets from Photoshop already has the image composited (based on the alpha channel) with a white background. So even if I just copy all the RGB and alpha data from inData back to outData, I end up with light-colored edges around the non-transparent parts of the layer. Simply setting inHiPlane=outHiPlane=3 (since all I really want to modify is the RGB data) doesn't seem to work either.

    Chris,
    I'm not sure what you mean by treating it as if there was no transparency. Simply copying the RGBA planes from inData to outData results in those light-colored edges. Likewise if I set inHiPlane=outHiPlane=3 and just copy the RGB planes.
    Can you tell me how to specify how the data should be matted? It seems to default to a white matte. Ideally, I would have thought I'd want to get from inData the color value at each pixel in the layer _before_ any matting is applied, along with the alpha values. Then for example, a red pixel at the edge that's 50% transparent would be RGBA = (255, 0, 0, 127). It seems like that's what my plugin needs to hand back to Photoshop (when I don't modify that pixel), in order for it to be able to correctly matte it against any background. Instead, what I get from inData is (255, 127, 127, 127), which then shows up when I hand it back as a pink pixel of 50% transparency on the edge. Can you tell me what I'm missing here?

Maybe you are looking for

  • How do I get calendar on a computer with Windows?

    I have a PC with Windows and want a calendar to sync with my iPod. Can I use iCal or is there another calendar that will work? Someone said I could use the Outlook Express calendar, but how do I find it? Thanks.

  • How do I stop iTunes from processing a podcast on my iPad?

    I have been trying to get to the next items to download in my iTunes downloads, but it has been over 24hours and this one file will not finish processing. After hooking the ipad2 to the Mac, it tells me that some videos in my iTunes library were not

  • Can I connect my iPad to an external CD burner?

    Am wondering if its possible to connect via hardwire or wireless to a CD/DVD burner from an IPad 4.

  • Sending and receiving SOAP over JMS in XI

    Hai All, I am working on a scenario in which I have to send a SOAP message over JMS adapter to XI and receive again the SOAP message over the JMS adapter. Here my questions are: 1.How can I configure the JMS adapter to get the SOAP messages into XI.

  • Order confirmation output is triggering twice

    Hi Gurus, I am facing the issue with order confirmation.After saving the sales order system has giving two outputs for order. I have checked the ExtrasOutputItem the output type for order confirmation has displayed two times.I have checked NACE setti