Composing transparent images with WritableImage and PixelWriter

Hi all,
I am trying to port some Swing apps over to JavaFX and have encountered a problem with transparency.
My code is as follows:
WritableImage bgImage = new WritableImage(960, 240);
Image bgTile = new Image(getClass().getResourceAsStream("/resources/background.png"));
Image bgCloud = new Image(getClass().getResourceAsStream("/resources/cloud.png"));
PixelWriter bgWriter = bgImage.getPixelWriter();
for (int i = 0; i < 60; i++) {
    bgWriter.setPixels(16 * i, 0, 16, 240, bgTile.getPixelReader(), 0, 0);
bgWriter.setPixels(20, 20, 96, 64, bgCloud.getPixelReader(), 0, 0);
bgWriter.setPixels(500, 20, 96, 64, bgCloud.getPixelReader(), 0, 0);The image background.png is 16x240 and is repeated 60 times along the X axis.
The image cloud.png is 96x64 and is pasted twice on top of the background.
The image cloud.png has transparent edges, but they aren't transparent in the resulting image, they end up being white.
Analogous code in Swing using a BufferedImage works just fine.
Am I missing something here ?

Likely a bug as that form of setPixels is supposed to take transparency into account.
File it with an executable test case and image files to: https://forums.oracle.com/forums/ann.jspa?annID=1713
As a workaround, you could create a Canvas and put the images in the canvas.

Similar Messages

  • White box behind transparent images with drop shadow in InDesign CC 2014 (v.10) but not in InDesign CC (v.9)

    Hi all,
    Please can you help? No matter what settings I use in my print options in InDesign CC 2014 (v.10), ALL transparent images with a drop shadow are printing with a white box behind the image. If I remove the drop shadow, all prints fine. I know this is an old issue that happens with ID sometimes but I have been lucky enough to never have had it happen to me before! (All images are regular flattened TIFF images with clipping paths).
    Also, feathered edges are not printing correctly and are sharp instead of feathered.
    When I export the document to IDML and open it up in InDesign CC (v.9) all prints perfectly with no white boxes and feathered edges prints perfectly as well. I have compared all of the print settings (including color management, transparency flattener, etc.) between both versions and they are exactly the same. I am printing to a Xerox color laser printer. Can anyone offer any advice?
    Thank you so much,
    Christine

    Okay...false alarm! It turns out that the issue was with my PRINTER settings (the settings you customize after hitting the “Printer” button at the bottom of the Print dialogue box in ID CC. I thought I had triple checked this but it seems there was one setting I missed earlier…adjusting the print brightness seemed to cause the issue. SO GLAD to know it was not InDesign…20 or so sheets/prints later….and thankful to know what was causing the issue! Thank you so much Steve for helping at any rate:) Much appreciated:)

  • How to make transparant images with more then 8 bit color?

    Hi,
    I know that one can use *.gif images in order to make a transparent image. But *.gif images have only 8 bit color depth. Is there a way to display for example *.bmp images and making one color transparent? Or by using a mask like in C++?
    thanx in advance

    Use the PNG format for your images. It supports a color depth of 24 bits/pixel as well as 8 bits/pixel and got an alpha layer so you can have transparent and semi-transparent areas in your image.
    You can load PNG images in Java as easily as you do with GIF and JPG images.

  • JS CS3 flag duplicate images with scale and rotation differnce

    I've been trying to cut down on the number of images a script I have would produce.  The old script would look for links that are being used multiple times and then just version the link which is fine.  What I am finding this that although a document may have one image linked 9 time 6 times out of the nine the image is scaled and rotated the same amount and the other 3 times the rotation and scaling also match. In this example the image only needs 2 versions the first as the original and the second with the scale and rotation of the image used 3 time let say.
    So to the code:
    The following code will work through the doc and create an array of the links as duplicates:
    function LinkUsage(myLink) {
        var myLinkCounter = 0;
            for (var myCounter =  0; myCounter < myDoc.links.length; myCounter++) {
            if (myLink.filePath == myDoc.links[myCounter].filePath) {
                myLinkCounter++;
        return myLinkCounter
    var myDoc = app.activeDocument;var myNumLinks = [];
    for ( var t = myDoc.links.length-1; t >= 0; t-- ){
        if(LinkUsage(myDoc.links[t])>1){
                myNumLinks.push(myDoc.links[t].id);
    Is there a way to loop through the array and only flag the differnent scale and roatations.  What I should get is that out of the multiple link uasage the image is only changed twice out of the 9 times used.
    I was trying to loop through the array and then loop through it within the loop to compare the link but this does not work for obvious reasons.
    for (var i=0  ; i <myNumLinks.length; i++){
        var valLink = myDoc.links.itemByID( myNumLinks[i]);
            if(valLink.parent.constructor.name == "Image"){
                for (var j=0  ; j<myNumLinks.length; j++){
                    if(myDoc.links.itemByID( myNumLinks[j]).parent.constructor.name == "Image"){
                        if(valLink.parent.parent.images[0].rotationAngle != myDoc.links.itemByID( myNumLinks[j]).parent.parent.images[0].rotationAngle){
                            $.write(myNumLinks[i]+"\n");
    Is what I am trying to do possible and if so any suggestions would be appreciated.
    Cheers, John.

    I think I might be one step closer to getting this to work.  I've been able to just capture the file path of the duplicates using:
    //count the number of times the link is used
    function LinkUsage(myLink) {
        var myLinkCounter = 0;
            for (var myCounter =  0; myCounter < myDoc.links.length; myCounter++) {
            if (myLink.filePath == myDoc.links[myCounter].filePath) {
                myLinkCounter++;
        return myLinkCounter
    //check if the filepath has been added to the array
    function chkVal(val){
        var compCount = 0;
        for(var arr =  0; arr < myNumLinks.length; arr++){
            if(val == myNumLinks[arr] ){
            compCount++;
        if(compCount >=1){
            return false;
            }else{
                return true;
    //check the links inthe doc
    var myDoc = app.activeDocument;
    var myNumLinks = [];
    for ( var t = myDoc.links.length-1; t >= 0; t-- ){
        if(LinkUsage(myDoc.links[t])>1){
            if(myNumLinks == 0){
                myNumLinks.push(myDoc.links[t].filePath);
                }else{
                    if(chkVal(myDoc.links[t].filePath)){
                        myNumLinks.push(myDoc.links[t].filePath);
    for (var i=0  ; i <myNumLinks.length; i++){
        $.write(myNumLinks[i]+"\n");

  • Transparency (true) with transset and xcompmgr

    Could someone please point me to a script or tell me have to achieve true transparency in Openbox with xcompmgr and transset (or transset-df)?
    I have it working to where you can set them each individually, but I want it set automatically when I start X.  I've also tried a couple other things such as the perl script on the transset-df page, but Ihaving gotten something working full proof.  Does anything know of something that will help?

    What do you mean by "set automatically"?
    If you want to have xcompmgr started with X you should add it to your .xinitrc file.
    If you want some per app settings, it will be difficult. There's transd but it didn't work for me. I was playing with xcompmgr only for a short time and I used the following script to make urxvt windows transparent.
    urxvtc &
    sleep 1
    transset-df --id `xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW): window id # " | grep -o -E -e 0x[a-z0-9]+` 0.65 &> /dev/null
    I use urxvtd deamon and every new window is a client (urxvtc). The script just starts new window, waits a second, then finds an ID of active window (which should be the urxvtc window opened just before) and sends that ID to transset-df. It's just a quick hack but maybe useful for you.

  • I just downloaded a movie and when I try to watch it, I just get an image with white and gray squares. ????  Sound is ok

    Hello:    I just downloaded a movie but I cannot any video when trying to watch it.  I just get n image of white and grey squares.   Sound is ok  ???

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Images with width and height

    There is a way to insert an image inside of the html code
    with width and height already? I mean, now, if I want to insert an
    image at the code, goes only <img src="images/test.gif" /> I
    d like that if I insert an image it goes as: <img
    src="images/canto_topo.gif" width="8" height="29" />
    is possible in dreamwaver to do that?
    Thanks!
    Vismona

    If you insert the image using the "Insert Image" function, DW
    will
    automatically insert the width and height.
    Or, if you'd rather insert them the way you are, in the
    Property Inspector
    on the far left, click the dimensions next to the Image
    field, and DW will
    automatically add (or correct) the width and height.
    Hope that helps,
    Patty Ayers | www.WebDevBiz.com
    Free Articles on the Business of Web Development
    Web Design Contract, Estimate Request Form, Estimate
    Worksheet
    "Vismona" <[email protected]> wrote in
    message
    news:gc60ut$nmv$[email protected]..
    > There is a way to insert an image inside of the html
    code with width and
    > height
    > already? I mean, now, if I want to insert an image at
    the code, goes only
    > <img
    > src="images/test.gif" /> I d like that if I insert an
    image it goes as:
    > <img
    > src="images/canto_topo.gif" width="8" height="29" />
    >
    > is possible in dreamwaver to do that?
    >
    > Thanks!
    > Vismona
    >

  • Problem processing RAW images with Lion and 3.1.3

    Images that have "This photo was adjusted using an earlier version of Apple's RAW processing.  Attempting to send to a plug-in or Photoshop results in a dialog "Editing Error This image cannot be rendered for editing because Aperture does not support the image format."  Images that were previously processed with the current version of RAW processing work correctly.

    There is another discussion for problem with raw and the new 10.7.3.1 : my Raw from Panasonic GH2 are green and Aperture says : treatment with old version
    I find the solution to correct my RAW : they are green because of the bad WB applied by Aperture.
    I put here the solution but I have to correct manually and ask to treatment in the RAW windows for each picture. If it doesn't work, I correct manually the WB.
    https://discussions.apple.com/thread/3942768?start=0&tstart=0
    We have to report this bug to Apple.

  • DHTML List (Image) with Sublist and authorization problems

    Dear all -
    I wonder if anyone can help with this DHTML drop-down menu query:
    We use hierarchical menus implemented as DHTML Lists (Image) with Sublists. When some of the items are hidden through authorization, the wrong headers appear for the menus.
    For example:
    Menu
      Item 1
        Subitem 1 of Item 1
        Subitem 2 of Item 1
      Item 2
        Subitem 1 of Item 2
        Subitem 2 of Item 2
    Say Item 1 and its subitems are all hidden through authorization controls. The heading for Item 2 then appears as 'Subitem 2 of Item 1' instead of 'Menu'.
    There's an example here:
    http://htmldb.oracle.com/pls/otn/f?p=11837:1
    Anyone know why this is happening?
    Thanks for your time.
    John.
    PS. Any idea where my previous post on this subject has disappeared to?

    Carl - in the example on htmldb.oracle.com, in Menu2 I'm hiding all the elements in Category 1 (parent and children), although not the 'grandparent' (Menu2).
    I'm therefore still expecting the menu title to be 'Menu2', because that's Category 2's parent.
    It doesn't appear to be an issue with the sequence of the items, because I've changed all those about and still got the same problem.
    To be more specific, again using the htmldb.oracle.com example, in Menu2 we have:
    Menu2
      Category 1 (Hidden)
        Item 1 of Category 1 (Hidden)
        Item 2 of Category 1 (Hidden)
        Item 3 of Category 1 (Hidden)
        Item 4 of Category 1 (Hidden)
      Category 2     
        Item 1 of Category 2     
        Item 2 of Category 2     
    And Scott - thanks for picking up the previous post - for some reason I couldn't for the life of me find that yesterday (in fact I still can't find it when I search).
    Thanks for looking into this.
    Regards,
    John.

  • Capture image with .wim and unattend.xml?

    Hi,
    We captured an image with the default wim of windows 7 + an unattend.xml. Now it seems this unattend.xml was not correctly applied (media center was removed but is still there, some components were installed
    but are not etc). Question: when capturing an image, you CAN use a default .wim right? Or should you use “apply operating system from original installation source” to have it applied correctly?
    Our problem is that our original task sequence had to many Windows updates and crashed. That’s why we are using offline updates which we include in the capture task sequence.
    If we would need to use the "apply operating system from original ..." then we'd need to:
    1.capture without updates
    2.import this wim into sccm
    3.offline update this wim
    4.use this for capture WITH updates
    Please advise. J.
    Jan Hoedt

    Have you tried making a package of your unattended.xml and pointing to it in your Apply Operating system step?
    If I remember correctly SCCM will make it's own unattended.xml even if one exists in the wim file, using the package of the unattended.xml that you have already created will make it use that one. Looks something like this in the task sequence with the highlighted
    yellow parts filled out by your package of the unattended.xml:

  • Resizing text and images with actions and keeping it resized for the next slides, how to?

    Hello everybody,
    I searched over the net and in this support section for a solution to my problem, but i didnt find any, so...here I am asking you experts.
    Through a particular use of different actions I make a logo "compose" in the first slide of my presentation (the logo is composed by text and images that interact), then in the second slide i make it resize so it goes 50% of its size and moves down like a TV logo, in the corner of the slide, and I want it to stay there for all the lenght of the presentation.
    It might be a stupid problem, but I didnt understand how to keep it there, 50% of its size and always in that position. If i duplicate the slide I obviously duplicate the 100%-size-logo, not its 50%-size-version, and if i shrink it in order to make it be 50% of its size the text size doesnt shrink so i have to change the text size manually, but the visual effect is imperfect.
    Lets summarize:
    slide 1: text appears, image appears, the text and the image move and "compose" the logo
    slide 2: the complete logo reduces its size to 50% and moves in the lower corner of the presentation, in the place I want it to be for, lets say, 20 slides
    slide 3: i want to have this logo already reduced in size and in its position, in the right lower corner, but if i try to group the different parts of the composed logo and i try to squeeze them the font doesnt change its size, I only squeeze the area that the text occupies.
    Some help please guys?
    Thanks in advance,
    Dom-
    (add: the problem is kind of similar to this: https://discussions.apple.com/message/9179367#9179367 . the idea of making a slide that contains the logo and text in the exact positions they would be after the move and scale actions is good and that was my first attempt, the probem is that it looks impossible to me to create a second "little" version of the logo that looks exactly the same of the first one that i reduced, so i hope there is some way to tell the app to use "the first logo, only resized the way i want", and thats the point where the problem with the size of the text comes out)

    Hi pritam,
    The “maintain proportions of window for different monitor
    resolutions” property will maintain the proportional size of the front panel
    (its x and y sizes) when opened in a different resolution. The front panel
    objects will not be resized and will appear larger (and may not fit inside the
    front panel) when saved in a higher resolution, and moved to a lower
    resolution. You can use the “Keep window proportions” property to achieve the
    same results.
    To have both the front panel dimensions and front panel
    controls scale, you need to have both the above property and the “scale all
    objects on front panel as the window resizes” selected. The labels will not be
    resized by this.
    I tried using both properties on two monitors and noticed
    that the change does not occur when the resolutions between the monitors are
    different. I had to lower both monitors’ resolution to see the change work
    properly.
    Please post back if you have any questions. Have a great day!
    Ryan D.
    District Sales Manager for Boston & Northern New England
    National Instruments

  • Transparency issues with INDCS3 and Pantone color

    Running Windows XP, Serv Pk 2, Creative Suite CS3, All updates.
    Heres the deal: We are having problems with PDFs printing and Ripping when using transparencies and drop shadows.
    Issue 1: INDD CS3 file with transparent PDF placed as image. Separate frame filled with paper, stroke and drop shadow placed under trans PDF file. Filled frame areas of percentage tint using a PANTONE color used on same page. File re-PDFed (compat to v6) and file printed correctly to XEROX 7760 and HP color. PDF views correctly. Recommended ordering policy applied to all layers as to keep drop shadow below text. PROBLEM: User running Acro 7 to printing to same color printers, receives copy with color tint areas missing.
    Issue 2: INDD CS3 file with solid Pantone color on background. Several text frames layered above. Under text frame a solid box with SOLID Drop shadow. PDFed using Acro 8. PROBLEM: User's RIP and DIGITAL presses do not recognize the drop shadow? White knockout box appears in this area.
    It seems that CS3 is handling transparency issues differently and/or that Acro 8 (compat to v6) is doing something different. The Acro 8 users have no problem printing or PDFing.
    Could this also be the "known issue" of transparencies and PANTONE colors? We are testing out converting all the colors to CMYK.
    Please respond at your earliest.
    KEN PANTHEN, Albany, NY

    Ken,
    If your final output is to the Xerox, which can't print Spot colors without converting them to CMYK, you should use process colors instead.
    Also, read the articles from InDesign Secrets:
    http://indesignsecrets.com/eliminating-the-white-box-effect.php
    http://indesignsecrets.com/eliminating-ydb-yucky-discolored-box-syndrome.php
    Peter

  • Images with success and error messages

    Hi,
    I am using theme 20. I want to add a success image on all success messages and an error image on all validation failure messages. I can do this by putting img tag in messages individually. Is there an easy way by which I can make sure that all success and error messages are always displayed with a corresponding image without including img tag in every message?
    Thanks,
    Bhavesh

    Hi Bhavesh,
    in page template there is Subtemplate region related to success, error and notification messages. You can put there your HTML tags and add some css class or image for every page using this template.
    Regards,
    Przemek

  • How to save a image with JSF and get your URL

    Hi
    I need to save a image to my file system and get your URL. I�m working with JSF.
    Ex.:
    1� Save a image Cup.jpg on the server
    2� Get your URL
    result: http://www.mysite.com/images/Cup.jpg
    Thanks!!!

    I don't understand what's the problem? Can you please elaborate? Show some code snippets and tell where you stucks on.

  • Is there a known bug when animating images with edge and dps?

    Hi, I've seen some oddities when using edge to create html5 elements for Indesign. Essentially I have spent hours trying to get an image to scroll from left to right. Works fine in a browser and worked fine in dps and iPad yesterday. Using the same setup: the stage in edge is 768x1024 I then animate a large image in the x axis 0 to -500 over 6 secs, I then apply a ease in and out. I then save the HTML, and publish for dps. Within dps I goto file > place and select the published file that edge generates for dps. I then update and preview either in desktop or iPad - the file loads but the animation does not play.
    Weirdly if I follow the exact same steps but add some other bits of animation ie drawing a square and moving it, the animation plays. If I open an existing file I.e your inbuilt tutorial files, delete the content and redo the image animation it works, it's only in a new project that it doesn't  preview or play in iPad?
    Another issue I have is when it does load the animation doesn't load in that well and shows most of the bottom and then after a .5sec the rest of it loads. so it's a vbit scrappy - any suggestions?

    Thanks,
    To give you a bit more info, we used my bosses computer and he was able to recreate the same issue with the animation not loading. however if we change the process by using the rectangular frame tool and using the web content folio overlay it works, and inserting the HTMLResources.zip. However we noticed that the animation did not run smoothly, very jerky like the ipad was struggling. I've now corrected this, by changing the properties of the image within edge from div to img. This seem to have worked nicely.
    So there are some weird things going on, more so around the publishing function within edge.
    Many thanks

Maybe you are looking for