Color Keying in Java

Hi all,
I was wondering,
Is there a way, when loading an image (with the image io package), or drawing an image (with a Graphics object) to make a certain color from the image be ignored and not drawn onto the content pane?
* I'm using Swing
I am creating game engine for my own simple game and I'm interested in a way to draw my own images externally and fill all areas I want to remain "transparent" while in-game with a certain color, say magenta... then I want my program to load these images and when I draw them, ignore the magenta pixels in a way that the background that's already there is showing "through" those un-drawn magenta pixels but not through the rest of my soldier image...
I've done this with C++ using either SDL or Allegro graphics libraries... but I'm sure that Java has some awesome class to do this...
JAVA IS THE BEST

There is no built-in class to do this that I know of. You can use RGBImageFilter, but then you have to worry about ImageConsumer/Producer and converting to BufferedImage if that's what you started with.
Take a look at the first response in this thread:
http://forum.java.sun.com/thread.jspa?threadID=783073&tstart=135
Good luck

Similar Messages

  • Getting generated keys inside Java

    Is there any way to get generated keys in Java running on CF
    server?
    I have some java code accessed from CF, I get a connection to
    the data source by name via
    "coldfusion.server.DataSourceService.getDatasource(datasourceName).getConnection()"
    call within java, which works. However if I try to do a
    connection.prepareStatement(sql,
    PreparedStatement.RETURN_GENERATED_KEYS) call or
    preparedStatement.getGeneratedKeyts() call I get a
    "java.lang.AbstractMethodError" exception like:
    java.lang.AbstractMethodError:
    coldfusion.server.j2ee.sql.JRunConnectionHandle.prepareStatement(Ljava/lang/String;I)Ljav a/sql/PreparedStatement;
    Which seems to indicate to me that CF does not implement
    getting generated keys via JDBC - is there another way or do I have
    to just give up and do a "select" after "insert"?
    Hope this made sense.
    Thanks,
    -HH
    P.S. In case this is usefull, CF MX7 with MSSQL2005 , JDK
    1.4

    Hichhiker wrote:
    > Is there any way to get generated keys in Java running
    on CF server?
    CF6/7 uses JDBC 2 so I don't think you can get it to work
    there. In CF 8
    it should work (if your database supports it).
    Jochem
    Jochem van Dieten
    Adobe Community Expert for ColdFusion

  • What's the best for green screen filter  Color Key or Chroma key?

    What is the difference, and what is the best choice for a person standing in front of a green screen.
    Color Key or Choma key?
    Which offers the most solutions for dealing with variations in the green background, such as occasional wrinkles/seams in the fabric.
    Thanks
    Rowby

    I did mean Adobe Ultra or previously Serious Magic Ultra. I have no personal experience with Primatte, but have heard very positive reports. For relatively simple work with a good green/blue screen, which is properly lighted and not too much wrinkles, Ultra is easy, fast and effective, but it pays to have a look at the tutorials on how to setup a proper key. When you have rather bad lighting on the screen, Keylight is better and adds more flexibility, but is harder to master than Ultra. It also lacks the MSL (Master Set Libraries) capabilities of Ultra, but if you have never used Ultra before, you may be hard pressed to find any of the MSL's from the Serious Magic era around. Adobe has apparently stopped selling those, apart from the basic one which is included with Ultra. Maybe Karl Soule or Mark Mapes, previous Serious Magicians, can shed some light on the future of Ultra in the Adobe portfolio.

  • Color Key plus RGB curves slowing down computer

    Just updated to Premiere CC 7.2.1 and when I use color Key and add RGB curves to a clip my computer shows down to an almost unsuseable level.  Slow is the new normal. 

    Hello,
    I'm sorry your experiencing this problem. Same question as Jim. Are you on Mac?
    We are aware of the performance issues that were introduced in version 7.2 with certain AMD GPU cards.
    We're investigating the problem now.
    I know this is not ideal but in the mean time here's a few workarounds:
    - Revert back to 7.1
    - Disable GPU acceleration when using those effects
    Here's a list of effects that seem most problematic:
    *Fast Color Corrector
    *RGB Curves
    *ProcAmp
    *Edge Feather
    *Lumetri Looks
    These effects do not appear hinder the performance in my testing:
    *All Blurs Effects
    *Three Way Color
    *Crop
    *Garbage Mattes
    *Levels
    Again, I apologies the the inconvenience.
    Best,
    Peter Garaway
    Adobe
    Premiere Pro

  • PP CS4 color key not working

    I have a very basic use case. I have done a simple 1 min screen capture video showing a software product demonstration. I have set the background to cyan for easy key out.
    However when importing to PP and adding a color key to cyan, Preview shows the color being removed. But after rendering the sequence out. The final video show a cyan background with no key color effect.... I have tried adjusing the options on the color key and different video output formats and options. But each time the color key does not seem to be reflected in the final render. like I siad preview window is correct, but after media encoder renders color key seems to habe been turned off.
    if I switch to chroma key, it work correclty. But I should not have to, since it is a solid color. and should be very accurate to key out using color key.
    And/also if I import the sequence (with color key) into AE... it render our correctly. The exact same thing. Renders inccorrectly from PP, corrrectly from AE, no changes etc..
    I am assumeing there must be some setting somewhere I am not paying attention to. I do not know AE well enough to rely on that to get my work done.

    to Chris Cox:
    >"Tony - then you'll need to contact NVidia and ask them to fix the driver.."
    I'll be happy to do so -- but to be effective in getting nVIDIA to accept responsibility for this problem, may I ask where you believe nVIDIA has done something which needs fixing?
    a) Is there a relevant industry standard to which you believe nVIDIA is failing to comply?
    b) Is there some specification published by nVIDIA to which you believe nVIDIA is failing to comply?
    c) Is there any documentation published by Adobe (e.g., design guidelines for graphics cards manufacturers to assist them in making Photoshop-compatible products) to which you believe nVIDIA is failing to comply?
    d) Are there specific generally-accepted good software engineering practices to which you believe nVIDIA is failing to comply?
    >"As for your display color management: we haven't seen that. That sounds a lot like your display profile is wrong, but I'm not sure why it differs from CS3. Could you check your color settings in Photoshop and for the display again?"
    These look right to me. Are there any specific settings you'd like me to report?

  • No Color Keying on Mac CS4?

    I'm a long time After Effects user and have become interesting in integrating Premiere Pro into my workflow. But I'm a little surprised that PP doesn't have any "real" color keying tools.
    Am I supposed to roundtrip all my footage to After Effects, use Keylight, and go back to Premiere?

    Having done a few green screen projects in my time, here's my workflow...
    To begin, do your entire edit first. Just use the PPro keyer to do rough keys, but save the real keying for later. Also, make sure you leave a bit of head and tail on your shots to be keyed - this may come in handy when/if you add transitions after final keying.
    When you've locked your edit, create a folder called AE keyed projects (or whatever works for you).
    Then, go to your first clip to be keyed, remove the PPro keying effect (if used) and right click on the clip and select "Replace with AE composition". This should open AE. Save the project with a name that identifys which clip it is (I usually use clip 1, clip 2, etc.) and save in the AE folder created - this helps keep track of the files if you need to go back and make adjustments. Use Keylight to key in the BG.
    When done, switch back over to PPro and you should see the clip keyed on your timeline. Adjust the head and tail if needed.
    Then go on to the next clip and repeat the process...
    There are a couple ways to do this process - this is just mine.

  • Reverse Color Key and Track Points

    In preparing for a more complex project, I've made a simple 3D scene using 3dsmax with a background and two spheres which are not visible just yet. The 3D camera then moves to view the two spheres which have a green circular area textured over each for color keying in after effects.
    I then want to place two separate video clips (personal interviews) in each green area of the spheres, but I don't know how to do this. I don't want to add the video clips in 3dsmax as a texture cuz the quality would not be as good, since they would be textures.
    I was thinking of having the 3d scene as the background layer in AE, and put clip1 in green area on sphere1 and use track points to track the movement of the sphere so clip1 would follow along inside sphere1's green area.
    Am I on the right track with this, or can someone offer a suggestion on how to do this, as I haven't been able to get it to work?

    http://www.adobe.com/devnet/aftereffects/articles/3d_integration_pt1.html
    Not specifically tailored for MAX, but covers the basic principles you will need.
    Mylenium

  • Applying Effects After Using a  Color Key to Remove Greenscreen

    I want to apply an infrared effect to a character on some greenscreen footage after using keylight to remove the greenscreen. When I apply the effect, it of course effects the color key, making all the removed greenscreen come back. I'm sure there must be a way to keep the screen matte data, before the effect is added, but I haven't been able to figure out how to do this.

    Some effects will overwrite the Alpha channel. In that case the procedures you choose are correct, if you want to keep the layer count low. Still, you may wish to check the layer's internal blendmode controls just to make sure. For effects like Colorama, you can also explicitly disable Alpha processing, so the source transparency remains intact. You could of course also use the Alpha Matte or Stencil Alpha modes to do the cutout using duplicates of the source layer.
    Mylenium

  • Is there a way to create/edit registry keys with Java?

    I'm writing a console app and I'd like to have it so the users can change values in the registry. I'm not just talking about app keys I want any key. Is there a way to do this with Java?

    Maybe a forum search on "Windows registry" would turn up some useful things. You're not the first to ask this. You might save yourself and everyone else some time if you'd simply do that.

  • Color Management in Java?

    How I can do Color Management to an Image in Java?
    Anybody can provide me sample code for Color Management?
    Color Management is working in Safari Browser.

    There is no built-in class to do this that I know of. You can use RGBImageFilter, but then you have to worry about ImageConsumer/Producer and converting to BufferedImage if that's what you started with.
    Take a look at the first response in this thread:
    http://forum.java.sun.com/thread.jspa?threadID=783073&tstart=135
    Good luck

  • How to store a RSA pair key in Java Key Store (jks) and VS

    Hi Everyone ,
    I have generated a RSA pair key . now I need to store my public key in a Java Key Store (.jks file) . and then I need to read this .jks file in another application and get this public key to use for verification .
    I'll appreciate it if anyone could help me with this matter with a sample code for import/export public key to/from a java key store file or any hints.
    Best Regards,
    Vivian

    I don't think this makes sense. How have you generated an RSA key pair and where is the result stored?

  • How do I create a stroke on a color key?

    Hey there,
    I've got some video of an athlete behind a greenscreen. I basically just want to see a silhouette of him with a red stroke outlining his body shape. Does anyone know if there's a plugin I can use for this in Final Cut Pro?
    Thanks,
    Caleb
    This is how I've got it to currently display. The only difference is I want the red stroke and then I'll put it behind a flashier background.

    Cool idea...
    Hope this is a solution for you:
    http://sight-creations.com/fxexchange/AlphaOutline.zip
    [install in ~/Movies/Motion Templates/Effects/<create category or place in Keying category>/ <place entire Alpha Outline folder inside> ]
    Ok - this effect works two ways:
    1) anywhere there is alpha an outline of the opaque media will appear (no alpha - no outline.) So, this effect will outline any keyed material.
    You have a control for the outline "Radius"; a Color control; a Blur control (nice for making "auras") and an Outline Mix control.
    2) if you choose to use the black/white mask (a.k.a. "matte") mode of the Keyer (which is completely opaque by the way), you will need to use the Luma Key Section of the effect (normally, just turning it on should suffice, but a few extra tools are included to help clean things up, if needed.)
    Parameter overview (with Luma Key Section turned on:)
    The line containing Luma Key Section is just a text only placeholder - the "menu" has no other use than to separate the sections. Toggle the use with the matte view of the keyer with Luma Keyer. The rest of the parameters are associated with the luma keyer that could be pubished (and that might be useful in this context.)
    It's free to download and use...
    HTH

  • Color Printing in java

    Can any one guide me to print colored characteres in System console?.
    I am starting many processes in my application and i want to show green OK for successfully started processes and i want to show red FAILED for failed processes.
    Please let me know is the above could be possible with java?
    Any help will be greatly appreciated.
    with regards,
    Kumar

    Hai JSalonen,
    Could you please let me know where can I find those escape sequences?. If they are platform dependent, then is there any special reason for not getting them in java standard libraries?
    Please help.
    with regards,
    Kumar

  • Solution Manager Key for Java AS

    I'm new to SAP Netweaver so maybe this question has been answered before.
    I need to install SAP Netweaver AS Java for development/QA purposes. I understand that I  need also Solution manager key for installation so I installed another Solution Manager System.
    When I enter to Solution Manager http://<server>:50000 I get "System Landscape Directory is not accessible. Only local system can be administered". What does it mean? I remember I chose to create local SLD.
    I saw also in couple of threads the following:
    Just go to transaction SMSY transaction of solman and locate the system for which you need to generate Solman Key and just right clilck on that system...You will find the option of Generating Solution Manager Key....
    I don't have such an option when I enter to Solution Manager.
    Any suggestions?
    Thanks,
    Haim Beyhan

    Hi,
    For Solman key generation refer the link below, which has the screen shots.
    http://www.saptechies.com/step-by-step-procedure-to-generate-solution-manager-key-smsy-solution-manager-40/
    Regards,
    Ravi

  • Errors with partitioning by callback or keys (JNI/Java), bug?

    Hello,
    Just upgraded to 4.8, to test new partitioning features. Seems to be not working for me, or maybe I'm doing something wrong?
    Vista 64-bit, Java 1.6.0_16 32-bit, BDB 4.8.24 32-bit.
    Callback-based partitioning:
    public class InfoDataPartitionHandler implements PartitionHandler {
    @Override
    public int partition(Database db, DatabaseEntry key) {
         return 0; // just testing
    DatabaseConfig cfg = new DatabaseConfig();
    cfg.setAllowCreate(true);
    cfg.setPartitionByCallback(4, new InfoDataPartitionHandler());
    cfg.setType(DatabaseType.BTREE);
    Database db = env.openDatabase(null,"test",null,cfg);
    And this is what I get when running, looks like a bug actually:
    Exception in thread "main" java.lang.IllegalArgumentException: DatabaseEntry must not be null
    at com.sleepycat.db.internal.db_javaJNI.Db_set_partition(Native Method)
    at com.sleepycat.db.internal.Db.set_partition(Db.java:497)
    at com.sleepycat.db.DatabaseConfig.configureDatabase(DatabaseConfig.java:2206)
    at com.sleepycat.db.DatabaseConfig.openDatabase(DatabaseConfig.java:2105)
    at com.sleepycat.db.Environment.openDatabase(Environment.java:314)
    Key-based partitioning
    Things are even worse.
    DatabaseEntry k1 = new DatabaseEntry();
    StringBinding.stringToEntry("111111111111111111111111", k1);
    int sz = k1.getSize();
    MultipleDataEntry keys = new MultipleDataEntry(new byte[sz]);
    keys.append(k1);
    DatabaseConfig cfg = new DatabaseConfig();
    cfg.setAllowCreate(true);
    cfg.setPartitionByRange(2, keys);
    cfg.setType(DatabaseType.BTREE);
    Database db = new Database("/tmp/test.db", null, cfg);
    db.close();
    Exception in thread "main" com.sleepycat.db.DatabaseException: DB_NOTFOUND: No matching key/data pair found: DB_NOTFOUND: No matching key/data pair found
    at com.sleepycat.db.internal.db_javaJNI.Db_open(Native Method)
    at com.sleepycat.db.internal.Db.open(Db.java:449)
    at com.sleepycat.db.DatabaseConfig.openDatabase(DatabaseConfig.java:2106)
    at com.sleepycat.db.Database.<init>(Database.java:103)
    at Temp.main(Temp.java:23)
    Please help.

    Hello. Thanks for this report, both situations you've reported are bugs in Berkeley DB. We are currently validating patches internally.
    Please contact me directly at ben dot schmeckpeper at the obvious domain.
    Thanks,
    Ben

Maybe you are looking for