Change IndexColorModel to create palette effect?

Here's one for you... Is there an easy way to change the palette in the IndexColorModel of a BufferedImage?
Here's what I'm doing: I've got an 8-bit IndexColorModel with some palette values set. I use that to create the BufferedImage, and then get a WritableRaster from that to create the graphics data. Basically, it's something like this:cm=new IndexColorModel(8,256,ra,ga,ba); // ra, ga, and ba are short for "red array" et cetera.
myimage=new BufferedImage(width,height,BufferedImage.TYPE_BYTE_INDEXED,cm);
WritableRaster r=image.getRaster();All of this is relatively simple everyday stuff, I'm sure, to the experienced Java 2D programmer.
Here's the fun part, though... I want to be able to specify a different palette every time I draw this BufferedImage to the screen (specifically, a Graphics2D from either a Frame or an Applet). I'll pass three 256-byte arrays (red, green, and blue) to a function which will use those colors to draw the BufferedImage. (This is to create some rather unusual color effects, naturally.)
Now it seems like it should be possible to do this by creating a new IndexColorModel every time, and using that and the existing BufferedImage's Raster to create a new BufferedImage, but that seems excessively wasteful. This is for a game, too, so performance is an important issue; I'd rather not waste time with wanton creation and destruction of hundreds of BufferedImage objects every second.
Is there a better way?

I would like to re-open this thread, Mr. Kglad, I did exactly what you told me, and you were right in everything, nevertheless, the effect like the  "relief" when the country brings out for a second and go back to its original position it's special, if you look at THIS map you can see the effect clearly, and as you can see the selected county "bounce" (I don't know if that make any sense) and go back to it's place while the mouse is over, that's the effect I want to achieve, is there any special event in AS3 in order to do that? it's seems like a mix of fade in and out... and lots of things.
Thank you very much for all of your help, anybody who could know the answer please give me a hand

Similar Messages

  • How do I create an effect on on object similar to this on Illustrator?

    How do I create an effect on on object similar to this on Illustrator?
    Please see the type show in the link provided : "CHIVAS"
    http://2.bp.blogspot.com/-F-lpKYp-QnE/UH8jwTkTmfI/AAAAAAAAOWQ/BuN9gm9Pe5U/s1600/Chivas+log o+2012.jpg
    Also if anyone knows what font this is, it would be much appreciated.
    Many thanks in advance,
    Nick

    Hello Ellie,
    This is what I do:
    First Create the brushes by selecting the shapes desired. Select the shape and place it into the burshes window.
    (Main Menu: Window + Brushes)
    Then A new window will show: Please select "New Scatter Brush"
    After you click OK, a new window will appear:
    In here I have selected Random Size, Spacing and Rotation. You may want to adjust the percentages to you design. The last thing to select is the Colorization Method; in this case "Tints" is selected because will allow me to change the color of the shape by using the color pallet window. After that click Ok and use the brush tool.
    This is the end result after using the Mask Feature:
    I know you can do something a lot better than this sample. I hope this helps!

  • Changing xml to create graphic hyperlink rolover?

    I use a text box created in Iweb as a hyperlink to other pages in my website. Is it possible to create a rollover effect by editing the xml file as discussed in the following thread:
    http://discussions.apple.com/thread.jspa?messageID=3288533
    I have followed Max Karreth's Instructions on creating rollovers which worked great, except for when the site is viewed on machines running IE the text in the graphic images I created for the rollover are fuzzy.
    Please let me know if the best way to create the effect I'm looking for.
    You're help is greatly appreciated.
    Imac   Mac OS X (10.4.9)  

    nope - there is no chance. sadly not! otherwise i would have integrated it into my templates
    btw - you could change all the links into a rollover, but that would mean that ALL links are a rollover.
    another way is to use iwebmore to edit the template files: http://iwebmore.ctrl-j.eu/iWebMore.html
    max karreth

  • Can anyone explain how to create this effect in Deamweaver and Fireworks?

    This site was oriinally done in dreamweaver - but the shadow
    effect was done
    outside of Dreamweaver. When I save to html and load into
    Dreamweaver it
    makes no sense to me.
    Can anyone explain how to create this effect in Deamweaver
    and Fireworks?
    http://www.fundflowsystems.com/test.php
    Thanks in advance,
    Joe

    Thank you so much...
    You is da bomb!
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:[email protected]...
    > Yes - a blank (completely blank) page.
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    > ==================
    >
    >
    > "Ken Binney" <[email protected]>
    wrote in message
    > news:[email protected]...
    >> Murray, one more favor if you would be so kind...
    >> Do you recall how this page degraded in Safari?
    >>
    >>
    http://www.binney.us/table-allcode.htm
    >>
    >>
    >> "Murray *ACE*"
    <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Nope. Sorry. You need a Mac.
    >>>
    >>> --
    >>> Murray --- ICQ 71997575
    >>> Adobe Community Expert
    >>> (If you *MUST* email me, don't LAUGH when you do
    so!)
    >>> ==================
    >>>
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >>>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >>>
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    >>> ==================
    >>>
    >>>
    >>> "Ken Binney"
    <[email protected]> wrote in message
    >>> news:[email protected]...
    >>>> Thanks Murray...
    >>>>
    >>>> Is there a way I can test for Safari on my
    PC XP ?
    >>>>
    >>>> "Murray *ACE*"
    <[email protected]> wrote in message
    >>>> news:[email protected]...
    >>>>> Fails in Safari, Ken.
    >>>>>
    >>>>> --
    >>>>> Murray --- ICQ 71997575
    >>>>> Adobe Community Expert
    >>>>> (If you *MUST* email me, don't LAUGH
    when you do so!)
    >>>>> ==================
    >>>>>
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >>>>>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>>>>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >>>>>
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    >>>>> ==================
    >>>>>
    >>>>>
    >>>>> "Ken Binney"
    <[email protected]> wrote in message
    >>>>>
    news:[email protected]...
    >>>>>> Here is a solution requiring NO
    images.
    >>>>>> The CSS and the Javascript can
    easily made remote the page
    >>>>>>
    >>>>>> <!DOCTYPE HTML PUBLIC
    "-//W3C//DTD HTML 4.01 Transitional//EN"
    >>>>>> "
    http://www.w3.org/TR/html4/loose.dtd">
    >>>>>> <html>
    >>>>>> <head>
    >>>>>> <title>Shadow</title>
    >>>>>> <meta http-equiv="Content-Type"
    content="text/html;
    >>>>>> charset=iso-8859-1">
    >>>>>> <script
    type="text/javascript">
    >>>>>> var depth = 6 // in pixels
    >>>>>>
    >>>>>> // addLoadEvent t
    >>>>>> function addLoadEvent(func) {
    >>>>>> var oldonload = window.onload;
    >>>>>> if (typeof window.onload !=
    'function') {
    >>>>>> window.onload = func;
    >>>>>> } else {
    >>>>>> window.onload = function() {
    >>>>>> if (oldonload) {
    >>>>>> oldonload();
    >>>>>> }
    >>>>>> func();
    >>>>>> }
    >>>>>> }
    >>>>>> }
    >>>>>>
    >>>>>> addLoadEvent(function() {
    >>>>>>
    >>>>>> var a = document.all ? document.all
    >>>>>> document.getElementsByTagName('*');
    >>>>>> for (var i = 0;i < a.length;i++)
    >>>>>> if (a
    .className == "shadow") {
    >>>>>> for (x = 0;x < depth;x++) {
    >>>>>> var newSd =
    document.createElement("DIV")
    >>>>>> newSd.className = "shadow2"
    >>>>>> newSd.style.background = a.id
    >>>>>> newSd.style.width = a
    .offsetWidth + "px"
    >>>>>> newSd.style.height =
    a.offsetHeight + "px"
    >>>>>> newSd.style.left = a
    .offsetLeft + x + "px"
    >>>>>> newSd.style.top = a.offsetTop +
    x + "px"
    >>>>>> document.body.appendChild(newSd)
    >>>>>> }
    >>>>>> }
    >>>>>> }
    >>>>>> }
    >>>>>> );
    >>>>>>
    >>>>>> </script>
    >>>>>> <style>
    >>>>>> .shadow {
    >>>>>> border: 1px solid silver;
    >>>>>> padding: 2px;
    >>>>>> font: 10pt arial;
    >>>>>> position: relative;
    >>>>>> display: inline;
    >>>>>> background: white;
    >>>>>> z-index: 100
    >>>>>> }
    >>>>>> .shadow2 {
    >>>>>> overflow: hidden;
    >>>>>> position: absolute;
    >>>>>> filter: alpha(Opacity=15); /* modify
    to change the shade
    >>>>>> solidity/opacity, same as below */
    >>>>>> opacity: 0.1; /* firefox 1.5 opacity
    >>>>>> -moz-opacity: 0.2; /* mozilla
    opacity */
    >>>>>> -khtml-opacity: 0.1; /* opacity */
    >>>>>> z-index: 10
    >>>>>> }
    >>>>>> </style>
    >>>>>>
    >>>>>> </head>
    >>>>>>
    >>>>>> <body>
    >>>>>> <table width="800" border="0"
    align="center" cellpadding="0"
    >>>>>> cellspacing="0" class="shadow"
    id="#000000">
    >>>>>> <tr>
    >>>>>> <td> </td>
    >>>>>> <td> </td>
    >>>>>> <td> </td>
    >>>>>> </tr>
    >>>>>> <tr>
    >>>>>> <td> </td>
    >>>>>> <td> </td>
    >>>>>> <td> </td>
    >>>>>> </tr>
    >>>>>> <tr>
    >>>>>> <td> </td>
    >>>>>> <td> </td>
    >>>>>> <td> </td>
    >>>>>> </tr>
    >>>>>> <tr>
    >>>>>> <td> </td>
    >>>>>> <td> </td>
    >>>>>> <td> </td>
    >>>>>> </tr>
    >>>>>> <tr>
    >>>>>> <td> </td>
    >>>>>> <td> </td>
    >>>>>> <td> </td>
    >>>>>> </tr>
    >>>>>> </table>
    >>>>>> </body>
    >>>>>> </html>
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>> "Joe"
    <[email protected]> wrote in message
    >>>>>>
    news:[email protected]...
    >>>>>>>
    >>>>>>> This site was oriinally done in
    dreamweaver - but the shadow effect
    >>>>>>> was done outside of Dreamweaver.
    When I save to html and load into
    >>>>>>> Dreamweaver it makes no sense to
    me.
    >>>>>>>
    >>>>>>> Can anyone explain how to create
    this effect in Deamweaver and
    >>>>>>> Fireworks?
    >>>>>>>
    >>>>>>>
    http://www.fundflowsystems.com/test.php
    >>>>>>>
    >>>>>>> Thanks in advance,
    >>>>>>>
    >>>>>>> Joe
    >>>>>>>
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >

  • Changing Ramp color in After Effects

    Hi all,
      I'm still new to AE and currently using step by step guides from books to practice in AE. In one of my practice, I'm creating a text animation with a ramps shader as the background as seen in my attached file here, and according to the book, no matter initial your color choice from your color picker, the ramp color will eventually default to gradations of black and white as seen in my file here. I wonder if there's any way that I can have more control of my color here, so I'll choose the color of my ramp.
    Thanks.

    Ok. Thanks for the uploading tip. I've enclosed the image as an attachment here for more clarification. hope it helps
    Ugoharris.
    Date: Sun, 22 Nov 2009 23:02:50 -0700
    From: [email protected]
    To: [email protected]
    Subject: Changing Ramp color in After Effects
    When attaching images, use the camera icon or the pix will get caught up in the virus queue. As I'm writing this, it's not yet visible. Anyway, I'm not really sure what you are describing, since you didn't mention what book and chapter and even then it's probably a newer revision which I don't have. There's a million ways to create gradients in AE, so probably you are simply missing something obvious.
    - Ramp effect
    - Ramp effect, followed by Colorama
    - Layer Styles - Gradient Overlay
    - Shape Layers with gradient fills
    For some specific cases, the effect may require to be applied to a solid, where the other layer, e.g. a text layer acts as the matte. also make sure to adjust the start and end points of the gradients to fall within the dimensions of the layer to be affected.
    Mylenium
    >

  • Is changing my AppleID going to effect my ownership to Lion?

    Hi all,
    Well i'm going through tough time figuring this out, I've created a new AppleID that i'm willing to use as the one and only. i'm having issues with my previous AppleID that's connected to my @gmail account,, well that account is no longer in use (though i can still access it) ..
    I browsed here and there about the effects of changing the AppleID and using it in iTunes Store, App Store (iOS & OSX) ,, I'm aware that no more updates are going to be available for my apps that I've downloaded using my previous AppleID , that doesn't matter much to me since I was sticking to free apps, except i'm wondering about OSX Lion, I've purchased Lion with that previous account, and now that i'm changing to a new AppleID i'm not sure how is it going to workout..
    I'm also willing to contact Apple Support to manually permanently delete/disable that previous AppleID,, and I'm starting over getting my apps again.
    Anyone can enlighten me about what are the exact issues that I might face changing to a new AppleID , and permanently disabling my previous one???
    Thanks in advance

    You are able to change your AppleID email association, effectively changing your AppleID from your Gmail to whatever you prefer and your past purchases, updates and all information will carry over.
    1. go to appleid.apple.com
    2. Click "Manage your Account" on the right side.
    3. Once signed in click the "edit" button next to "Apple ID and Primary Email Address.
    4. Delete your current email address, and enter the desired new email address.
    5. The system will email you a confirmation link, so check your email and follow the link to confirm.
    6. Your AppleID is now changed, and all your purchases and iTunes Store account and everything with Apple will associate with it.
    EE

  • I used to have a podcast that had been accepted on Itunes, but my I began to have problems with my host, so I changed host and created a new podcast, and I submitted my new podcast, Apple refused, and now says the feed has already been submitted??

    I used to have a podcast that had been accepted on Itunes, but my I began to have problems with my host, so I changed host and created a new podcast, and I submitted my new podcast, Apple refused, and now says the feed has already been submitted? Maybe Itunes thought that I was someone trying to copy my old podcast because I kept the same name, I tried to change the names but it looks like I'm on a blocked list...

    There is a procedure for changing the feed URL for a podcast, which it seems you haven't followed: you have to add a special tag to the old feed - just submitting a new feed will have exactly the effect you describe. The proper method is described here:
    http://www.wilmut.webspace.virginmedia.com/notes/podcast.html#move

  • Changing the language in After Effects cs5

    Hello, I'm trying to change the language in After Effects cs5 from German to English on a mac (10.8.5 osx). I've tried going to package contents/resources/AMTlanguages and changing de_DE to en_US  but when I restart it and enter the serial number it says its incorrect for this product. I was able to change photoshop without any trouble but does anyone know if AE has a language specific license? help please and thank you!

    Any standalone retail package is language specific as dictated by the serial number and installer. Lucky for you, you can easily set AE to English by creating a file called ae_force_english.txt in your user profile's documents folder. the file doesn't need to contain anything, it just needs to be present and named properly.
    Mylenium

  • How would you create this effect?

    I am curious if there is a fairly straight-foward away of creating the effect seen in this image. I am talking about the pixelated effect made up of many little red boxes of various hues at the top part of the image.
    I was thinking of zooming in real close to an image in photoshop and doing a screen capture, but I'd rather have a vector image that can be easily scaled in size and easy to change the hue to different colors.
    Something like this able to be done in illustrator without building it a box at a time?
    Regards,

    Well I'd say that PDF is a vector.
    The PDF contains nothing other than a raster image. It contains no vector paths.
    (By the way: "A vector" is a single expression of a direction. Calling a vector-based illustration "a vector" is like calling a raster-based image "a pixel.")
    I zoomed in as close as I could and didn't see any pixels.
    All you could see is pixels. That's all that's there.
    If it's raster I'd be interested in knowing what resolution...
    Its resolution is 1. It's a single-pixel raster image (as given away in its title).
    I've never experienced a raster image that didn't get more pixelated the larger you scaled it up.
    Yes, you have. That's exactly what I demonstrated in post 5 and in the PDF.
    The operative word in your comment is more pixelated. That misconception is the point of the demonstration. Your image is already pixelated, and that's exactly what you want. It won't be "more" pixelated whatsoever, no matter how large you scale it.
    At the heart of the [quite common] misconception is this: What you are calling "resolution" is not. True resolution is the measure of the amount of information contained. A raster image contains only a fixed amount of information. PPI is merely a scale factor. It's merely an expression of information density, not quantity. As you can see, that PDF is every bit as "resolution independent" (i.e.; scaleable) as a vector square.
    The same priciple applies to your raster image. Your whole intent in your posted example is to display pixelation. So if the very thing you're trying to depict is the pixelation of, say, a 10 pixel x 20 pixel raster image, then all you need in order to depict that at any scale is a 10 pixel by 20 pixel raster image. At a scale of 10 PPI, you've got a perfect depiction of 10 square Pixels Per Inch. At a scale of 200%, you've got a perfect depiction of 5 square Pixels Per Inch (i.e.; 10 Pixels Per 2 Inches). You can scale it to the size of the moon and you'll have a perfect depiction of 10 Pixels Per Moon. It's just as scaleable as a 10 x 20 array of vector squares.
    In other words: All the actual resolution of your raster image (all its information—all its pixels, in all their squareness) is already visible. Reducing its information density (by scaling it larger) will not reveal more of its actual information (the square shape of its pixels—the information that one usually wants to conceal or disguize about raster images, but not in this case).
    The whole purpose of making sure your raster images have "sufficient resolution" in desktop publishing is to disguise the squareness of their pixels (what is commonly called "pixelation"). But that is exactly what you are intending to depict in this case. And you want to be able to depict that with equal clarity at any scale. There's no need to re-draw it as vector paths in order to do that. In this situation, you are not trying to avoid "pixelation," you are trying to show it, which is exactly what a raster image does by its nature.
    Think of it this way: If all you are trying to draw is 200 squares, it can easily be argued that a raster image is more "data efficient" than a file containing 200 square vector paths. For each vector path, you have to include four coordinate pairs (800 anchor points). For a raster image, all you need is 200 color values.
    This is not just a symantic or academic or pompous know-it-all point of argument. It's a point widely applicable to many common situations, and something every graphics professional should understand. For example, consider the software instructions author who pointlessly frets over the misunderstood "requirement" for pixel density when his illustrations necessarily consist of screenshots that are, after all, supposed to accurately and clearly depict what the user sees on his screen. Or the fact that you see single-pixel raster images scaled to the full width of the page, or dimensions of a table cell or large section of a whole background on web pages everyday. Or the widespread misconception that intentionally fuzzy raster effects like soft drop shapows "require" 300 PPI.
    JET

  • How can I create an effect to cycle through several sets of 12 thumbnail images rather than just one

    Hello
    I've searched everywhere i can think of and had no luck so thought it's about time i asked for help.
    How do I create an effect where a group of 12 thumbnail images (all with clickable links) can scroll across by clicking a button to reveal another set of 12 thumbnails and so on without having to refresh the page, im assuming jquery can help but every single slideshow or scroll effect I've come across is for single images and not a set of images.
    Its a gallery part of my website and the images are in sets of 4 in 3 rows.
    All and any help will be greatly apprieciated!
    Anthony

    I think what you want is a Carousel Scroller.  See Demo and Examples
    http://dimsemenov.com/plugins/touchcarousel/
    Nancy O.

  • My apple id is with gmail, I want to change it and create an @me email address. How can I do this?, My apple id is with gmail, I want to change it and create an @me email address. How can I do this?

    My apple id is with gmail, I want to change it and create an @me email address. How can I do this?, My apple id is with gmail, I want to change it and create an @me email address. How can I do this?

    You can't merge accounts, if you start using the gmail account for iCloud by logging out of the me ID in system preferences and back in using the gmail ID, you'll need to copy all your data in calendars etc to the gmail account. you also won't be able to use the me address for mail unless you add the me account as a secondary account at system preferences > mail, contacts and calendars.

  • HT204053 Why I can't purchase anything from UK Appstore? It says my ID connected to Kazakhstani store and I can't use it here in UK, I used to live in KZ. How to change stores? Create new ID? But I still have my old e-mail address, will it valid?

    Why I can't purchase anything from UK Appstore? It says my ID connected to Kazakhstani store and I can't use it here in UK, I used to live in KZ. How to change stores? Create a new ID? But I still have my old e-mail address, will it valid as a new ID?

    Welcome to the Apple Support Communities
    You can only purchase content on the Kazakhstani store because you created your Apple ID on that country. To change the country, see "Change your iTunes Store country" > http://support.apple.com/kb/HT1311?viewlocale=en_US&locale=en_US

  • Is there a way to change the default angle for effects or a quick way of selecting 90 or 180 without typing in numbers?

    is there a way to change the default angle for effects or a quick way of selecting 90 or 180 without typing in numbers?

    The app developer chooses the alert sound, or provides a way for you to change it.

  • How do i create an effect of binoculars on a video\pic in premiere cs3?

    is it possible to create an effect of binoculars on a video\pic in premiere cs3?
    iv'e tried looking but i cant find
    does any of you know anything about it?

    Try searching for
    mask
    in the help file

  • How do I change a form created by a departed employee?

    How do I change a form created by a departed employee?

    Some of those things involves using the various form field tools that are available in Acrobat 7 Pro (but not Standard). More information on working with forms is in the help doc.
    Moving text that's part of the regular page contents can be difficult or impossible. Deleting things is easier, but still may be difficult to get everything just as you want. The ideal way to make such changes is to change the source document and generate a new PDF, and then in Acrobat replace the old pages with the new (Document > Replace Pages). Any fields and other annotations, bookmarks, code, etc. will be retained.

Maybe you are looking for

  • How to find better SQL log in OBI Answers?

    While I have an error in making an OBI request in Answers page, the error message in the result tab is usually not very helpful, like: Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError:

  • Open PDF link in new browser window?

    I'm viewing a newly created PDF in a browser. When clicking an internal link, the linked PDF loads into the same window I need it to launch in a new browser window. I have set the link to "launch new window" in Word where this file originated. I have

  • Applying a CSS style to an existing web page

    Hi all. I have recently updated the look of one of my web pages in my site. I'm looking to update the look of the other pages in my site as well to the same style/look. I have a CSS style saved as  "main layout" that I would like to use to apply the

  • Print option in Actionscript 3.0

    Hi, I want to print movieclip. But the following code print the center of the pdf (small size movieclip). I want to print the movieclip full page (in pdf). function printMe(e:MouseEvent):void {         layoutimage_mc.addChildAt(layout_mc, 0)     var

  • Printing with CS6 Beta on Epson 2880 ?

    I'm having the same problem printing with CS6 Beta that I have with CS5 (but not with CS4):  the colors are grayer than appear on my calibrated MacBook Pro screen.  A difference with CS6 Beta is a redder red, but stil the same grayed out colors. I've