Convert color to float

Hello!
I�m using a JColorChooser to pick a color and I wanted to convert this value in a float.
Using :
Color color = Painel_cores.getColor();
float[] myColor = { color.getRed(), color.getGreen(), color.getBlue() };
I get trash that can�t be used�
Using:
float corRed=color.getRed();
float corGreen=color.getGreen();
float corBlue=color.getBlue();
I get the 3 components separate. How ca I join them to have (255,255,255) ?
Thanks
Nuno

I�m using a JColorChooser to pick a color and I
wanted to convert this value in a float.A float array, I assume after reading the following:
Using :
Color color = Painel_cores.getColor();
float[] myColor = { color.getRed(), color.getGreen(),
color.getBlue() };
I get trash that can�t be used�That surprises me because you simply get a float array containing
three elements, all set to their correct values after being cast to type
float ...
Have you tried to print the three values and what were the results?
kind regards,
Jos

Similar Messages

  • Convert Color PDF to Grayscale using Preflight in Acrobat 9 Pro

    Has anyone posted a step-by-step procedure to convert color PDFs to grayscale? I've unsuccessfully been trying to use the new Preflight dialog to do this. This is the procedure I tried:
    1) In the Preflight dialog, Create New Preflight Fixup.
    2) Fixup Category: Color Spaces, Spot Colors, Inks. For Type of Fixup: Convert Colors.
    3) In the Conversion settings tab, chose All Objects, Using Any Color (except spot colors), plus All Objects, Using Spot colors(s).
    4) For Destination, I chose a grayscale destination Dot Gain 25%.
    5) After clicking OK, I selected the new profile and clicked on the Fix button, and saved the file.
    Nothing happens, and the colors don't change.
    If anyone can explain what I'm missing, I would greatly appreciate it.

    Refer to Acrobat 9 Help PDF (installed with Acrobat 9 is installed).
    Review the  discussion for Exporting PDFs in Chapter 5 of this Help PDF.
    The PDF is also available on Adobe's site.
    http://help.adobe.com/archive/en_US/acrobat/9/professional/acrobat_pro_9.0_help.pdf 
    Good to know is that the Acrobat 9.x product family passed into End of Support mid-year 2013.
    Be well...

  • How I can access "Convert Colors..." button in Adobe Acrobat XI using applescript, or add this button to menu bar?

    Hi, I'm writing applescript to automate Adobe Acrobat XI, I'm missing only one line of code - opening dialog window of "Convert Colors..." tool. It was easy in Acrobat 9 but some reason it's complicated in Acrobat XI.
    Is there an option to add "Convert Colors..." as menu item into menu bar?

    Thanks Gilad D. I created JS file with simple code
    app.addMenuItem({cName:"Convert Colors", cParent:"View", cExec:'app.execMenuItem("ColorConversionMenuItem");'});
    and I added it into acrobat (USER/Library/Application Support/Adobe/Acrobat/11.0/JavaScripts/).
    I enabled menu items JavaScript execution privileges in Acrobat Preferences.
    Now I can open "Convert Colors" from main menu bar, and create applescript which do the same.

  • Convert Colors profile to threshold to black? [A9]

    Is there a reasonable way to create a color profile that can be used with Convert Colors to apply a threshold (180/255) function to convert an RGB PDF into a black-and-white PDF? Acrobat 9 (CS5), OSX 10.6.7.
    I have some multipage PDF files I want to "sharpen" (make clearer) before printing, and found that opening a page in Photoshop and applying Image > Adjustment > Threshold to 180 (out of 255) does a nice job. This is a pain for multipage PDFs because I have to extract the pages from Acrobat, apply a batch action in Photoshop, and then (potentially) re-integrate them into a PDF file.
    Acrobat can apply ICC profiles to convert an image via Advanced > Print Production > Convert Colors. But how can I generate an ICC profile that does something analagous to the threshold function?
    One crummy way is in Photoshop. Edit > Color Settings, which allows you to define a custom CMYK profile. Under Dot gain, you can set transfer function curves for C,M,Y, and K. I tried doing that, with curves at zero up until 70%, at which point I ran them straight up to 100% with a very steep (almost vertical slope).Tried a bunch of GCR/UCR/Black conversion settings. I saved the profile so Acrobat could see it. This gave me weird results:
    In Photoshop, it came close to doing what I wanted, but not totally, when I converted the image to that profile. But it wasn't drastically wrong. But when I applied the same profile in acrobat (with Convert Colors), it looked much much worse, with large blocky pixel groups and the document, which was mostly a raster image of text, almost unreadable.
    (Sorry for the lack of screenshots/images -- they're at the office, I'll post them tomorrow...)
    Any tips? Is there a better way to do what I want and apply a simple transform to a PDF file?
    A better tool to create ICC profiles for Acrobat's Convert Colors?
    Am I just using the wrong settings in Photoshop?
    Thanks!

    OK, some more info. So, my PDF contains letter-size pages with 300dpi 8bpp images that are DeviceRGB DCT-encoded (JPEG). Here's how Acrobat displays one of the characters:
    (All those obvious JPEG artifacts which explain why it prints badly and would benefit from processing). It looks pretty much the same in Photoshop (via Edit Image from Acrobat, or opening the PDF file directly). Thresholding it to 180 in Photoshop does a great job:
    For simplicity, I tried to build a Gray profile that did what I wanted. But it looks like Photoshop's gray profiles only let you adjust dot gain and gamma, and neither of those are sufficient to achieve this kind of effect. RGB doesn't let you use curves. So I converted the image to CMYK, and then Edit > Convert to Profile, then choose CMYK and Custom CMYK and define a profile like this:
    with these Curves:
    And it seems to do the right thing when the image is converted to it in Photoshop; not perfect but much better than the source:
    So, back to Acrobat, and apply the profile with Convert Colors:
    basically a disaster. and some very faint jpeg artifacts turn into a big blue rectangle.
    So what to do? Is there a better way to construct these profiles? Or should I give up and use batch operations?

  • Preflight Convert Color Problem

    Hello everyone. I work in the preprint division of a printing press. We have recently upgraded all our systems to x Acrobat Pro 10. We run the preflight utility on most of our files that we get in from our customers. However, to knock out a lot of 4 color type, we have to manually use the "Convert Color" tool on each PDF to the SWOP profile. I've tried to adjust some current preflight fixups to this for us automatically, but I cannot ever get it set to correctly convert the colors in the same way that the SWOP profile does when we do it manually. I'm not sure if I should be checking the "output intent" box or not. Any help would be much appreciated.

    Could be an Illustrator graphic that is not set up correctly. The name of the PMS color in your linked Illustrator file should match exactly with the name of the spot color in InDesign.
    You'll also want to check carefully to make sure your spot color is set up exactly the same in both applications.

  • Problem when converting colors to cmyk using fixup

    The problem is in the fixup -> colorspaces -> Convert colors.
    It seems "Rendering Intent" is in fact always relative, although e.g. perceptual is selected.
    Am I doing something wrong?
    If not, Is there a solution or work around?

    hi monika!
    no they are just plain old paths in black. and the TIFF file is just a regular TIFF file that is being placed on the bottom layer.
    thanks for any help!!

  • Converting string to float

    I have a decimal string "122339994" which i am trying to convert to float using Float.parseFloat. This results in incorrect value of 1.22339992E8.
    I thought for floats precsision comes into effect after decimal places.
    public static void main(String[] args) {
    String floatString = "122339994";
    float floatNumber = Float.parseFloat(floatString);
    System.out.println("Float is "+floatNumber+". Now double "+Double.valueOf(floatString));
    }

    See this API
    [Java2SE Float|http://download-llnw.oracle.com/javase/6/docs/api/java/lang/Float.html#valueOf%28java.lang.String%29]
    Note that trailing format specifiers, specifiers that determine the type of a floating-point literal (1.0f is a float value; 1.0d is a double value), do not influence the results of this method. In other words, the numerical value of the input string is converted directly to the target floating-point type. In general, the two-step sequence of conversions, string to double followed by double to float, is not equivalent to converting a string directly to float. For example, if first converted to an intermediate double and then to float, the string
    "1.00000017881393421514957253748434595763683319091796875001d"
    results in the float value 1.0000002f; if the string is converted directly to float, 1.0000001f results.
    Its better to see the Java APIs first for any information, we will get almost all the information we need from APIs
    Regards,
    Venkatesh

  • Adobe Employees: View Tools Print Production Convert Colors

    Totally don't get your View> Tools> Print Production> Convert Colors dialog.
    I would expect that if it was working that all Tagged files (left column) would display correctly.
    But in every test it appears all that happens is my profiles are stripped.
    Can you possibly let me know what I may be missing as no one else seems to be able to?
    Here is my control .pdf download:
    gballard.net/photoshop/pdi_download/PDI_Color_Profile_Test.pdf
    Here is how it displays Acrobat Pro 10.1.5 (as expected):
    Left column is Taggged as noted (displays proper as expected).
    Right column is Untaggged as noted (displays unmanaged).

    i had a revelation slugging this out:
    Acrobat Print Production> Convert Colors behaves nothing like i expected (accurately transforming Tagged source colors to a Destination profile)
    i am still interested if this is possible, but this is what i believe is happening (and it is easily proven in Photoshop on the monitor)
    During Acrobat's "Convert Colors" process (using my conversion settings):
    Acrobat IGNORES the profiles embedded in my RGB images.
    Acrobat "Assumes" its Working RGB profile (on all Tagged/Untagged images) and then
    Acrobat "Converts" everything to the Destination profile and embeds that profile.
    Here are my Acrobat Color Settings (Working RGB is ProPhoto RGB):
    Here is how those settings display my original .pdf:
    Note: This is totally predictable and how Photoshop displays Tagged and Untagged color (Photoshop properly "Converts" or transforms Tagged color to the monitor profile; and Photoshop, like Acrobat, "Assumes" its Working space on Untagged colors).  That means the left column containing all Tagged images are displaying the same as Photoshop, and the right column of Untagged images are each uniquely different.  In fact, the Untagged ProPhoto RGB is the only Untagged image displaying proper because Acrobat made the proper Assumption.
    Here are my Acrobat Convert Colors settings (my best guess for a simple Source> Destination conversion):
    Here is the result using the above Working RGB and Convert Colors settings:
    Note: This is crystal clear.
    To prove it in Photoshop one would merely have to open each of the original 10 files and Assign ProPhoto RGB to each file, then Convert each one of them to WhackedRGB (and this is exactly what I would expect to see).
    And here's the proof:
    I dragged the Converted .pdf into Photoshop and "Used the embedded Profile" (Whacked RGB) to open the ProPhotoRGB image -- as you can see -- Acrobat made a proper conversion to Whacked RGB, correctly embedded the Destination profile, and is displaying it proper.
    i am still really interested if Acrobat is capable of properly Converting multiple Tagged elements to a single tagged Destination profile -- i.e., my five tagged images in the left column display properly (like Photoshop displays them)...
    PS: I did the exact same series of tests/screenshots using WhackedRGB as my Acrobat Working RGB -- the results were as predicted (Whacked RGB was the only source space that properly converted).

  • Illustrator CS2 Start up - Convert color mode dialog box

    Using Illustrator CS2, on opening, the usual loading prescreen appears, after which a dialog box appears showing the following text
    "Convert Color Mode"
    "The document contains objects using both CMYK and RGB color modes. Illustrator allow only one color mode per document. Which color mode would you like to use? (RGB and CMYK appear as option boxes)"
    This dialog box appears every time I open Illustrator, even though I'm not actually opening a document.
    I've tried adjusting the Color Settings (Edit> Color Settings) but this hasn't affected the dialog box appearing.
    I've checked all the usual sources of help but can't identify any cures.
    I want to be able to change this so the dialog box no longer appears as it tends to "hide" behind all the other applications I have open at the time and can be difficult to get to, meaning opening Illustrator is a 5 minute battle.
    Any ideas?
    Thanks

    You haven't messed with the startup .ai files have you?
    You might try deleting the ai prefs file (see FAQ), though that might be a reach in this case.

  • Convert Colors RGB to CMYK something i don't understand.

    Hello!
    I'm still "fighting" with maximum TotalInk. There is the problem. Indesign have background and overlaying image with effect - Multiply. So it's extremely hard to avoid not exceed maximum ink. Indesign don't provide normal way to do it and i start to torture Acrobat for that. First step was create Postcript file then distille it to RGB and then convert by Acrobat X Pro (Print Production/Convert Colors).
    Theoreticly everything worked out fine. Black text stayed black (which is miracle) and images went to RGB and back to CMYK. BUT...and i don't understand why - Convert to Profile with Perceptual didn't converted it same way as Photoshop. It still got some points which exceed TotalInk (i used profile with maximum 300). AND image has drastic loss of quality! What did i do wrong? I tried to make Preflight new fix which do same thing and it worked - no exceeds of limit but still BAD quality! What did i miss?
    Thanks.
    P.S. If something isn't understandable please ask, i'll try to make my point more clear (english isn't my first language).

    The 'create album' button is identical to File>New From Selection>Album (Command-L).
    Oddly enough, this gives different behaviour from File>New>Album...
    In other words it makes a new Album with the entire Project's-worth of images in it only if you had nothing selected. It's an assumption on the part of the developers - you've asked for a new Album containing the selection, but nothing's selected - do you throw up an error message (like the one when only one Version is selected), or assume that the user wanted everything.
    Personally I think Aperture should throw up a dialog box to keep things consistent, but I can see the reasoning behind it. And as long as we've got menu items and keyboard shortcuts for both, I don't really care.
    Ian

  • Persistent "Converting colors to CMYK" progress bar

    There is a file I've been working on for a couple of weeks that I am all of a sudden having issues opening. I applied some effects to a photo within the document, and ever since then the program has been freezing up or having issues opening the file. It keeps on cycling through dozens of progress windows that say "Converting colors to CMYK". The progress bar loads in about 10 seconds before another one, exactly the same as the last, shows up. I've sat there and watched it cycle through like this for over 30 minutes on multiple occasions in the last 24 hours, just trying to be patient and see if it will ever load.
    I have tried rebooting the computer, restarting the program, and downloading the latest updates. Nothing has made a difference. The file size is 26.6 MB with around 20 photos in it, and my computer isn't the fastest in the world, but this shouldn't take forever. Does anyone have any advice on this?
    Thanks,
    Zac
    2010 MacBook Pro 13"
    2.4 GHz Intel Core 2 Duo
    8 GB 1067 MHz DDR3
    NVIDIA GeForce 320M 256 MB

    I don't know if this will work but try setting the scratch disk for Illustrator to the Seagate instead of the internal HD and see if you have better luck. With less than 20% of the HD available it is starting to become a problem. Have you ever resaved the file with a Save As and overwritten the original? If you have been changing the images without doing this there is likely a lot of old previews and such held in the hidden part of the file which will be cleared by doing this.

  • Convert string to floating-point

    Hi all,
    ..very basic question, but I tryed it for hours and only received short-dumps
    <b>How can I convert a string into a floating-point number?</b>
    Kind regards,
    Stefan

    hi
    try this
    to convert  string to float.
    data : a type f,
    s type string value '1.023'.
    a = s.
    write :/ a.
    to convert float to string.
    data : a type f value '1.023',
    s type string.
    s = a.
    write : s.

  • How do I convert color image to color vector?

    Hi,
    Im fairly new/not very well versed in Illustrator, I was wondering if you guys could help me with instructions or tips how to convert old alphabet art to color and actualy converting color images like drawings to vector . Ive tried image trace but it turns the image black and white and with really rough strokes.
    Thank you!

    Is this art in the Public Domain? Or, do you have the copyright owner's permission to use it in your work? If the answer to both of these questions is no, then you should not be using it.
    That being said, I got good results with image trace (using the High Fidelity Photo preset) even on the low-res image you attached here. You just have to adjust the preferences after you do the trace.

  • Convert colors Acrobat X problem

    In previous versions of Acrobat the Convert Colors dialog could make cmyk to cmyk color conversions from the source profile set in the preferences to the chose destination profile.
    This is broken in Acrobat X, but worked great in Acrobat 9.  When converting to an Output intent the embedded output intent profile changes, but no actual conversion of the color numbers occurs, so the Output Intent profile is now mismatched.
    Why does this no longer work?

    "we already fixed it"   ... ???
    We who?  Are you an Acrobat programmer?  If so, then you have my admiration because it is a really awesome program.
    In Acrobat 9 "convert colors to output intent" performs exactly as the help file describes, and now in X it is completely non-functional for already cmyk pdf documents other than soft-proofing cmyk numbers by only embedding an Output Intent profile that may or may not match the actual color space of the document if it started out in cmyk. 
    How do you explain the disparity of the Adobe help instructions and what you are saying is the proper functionality here?
    I can understand if you wanted the ability in Acrobat to embed an output intent profile without making a conversion of the color numbers.  In fact this is a very useful function of the Output Intent panel of Enfocus Pitstop. The problem that this presents in my opinion is the removal of the functionality present in Acrobat 9 and described in Adobe help to accomplish that goal if that is what you are saying. 
    How am I to make such effective and quick cmyk to cmyk conversions of entire pdf documents without making all of the black text 4-color process if I do not use the functionality in Acrobat 9 or the functionality described in Adobe help?  If what you say is true and you inadvertently created an extremely useful functionality by accident in Acrobat 9 that is no longer available in Acrobat X on purpose then that is very unfortunate for my workflow. 
    I think that you are confused since the help describes Acrobat 9 functionality perfectly. 
    How do you explain away the preservation of black that occurs in 9 and as described in the help?
    Why would you even need to preserve the black if no change in cmyk color numbers is made?
    If you convert an RGB document to an output intent in X it converts the color to the cmyk numbers determined by the output intent profile that you chose in the dialog.  With the functionality in 9 I could in one simple step convert every cmyk object in the pdf except for black text into any particular press's profile space creating cmyk numbers that would print perfectly with the intended color just the same as if the original document had been all RGB.
    So now in X if I want to convert all of the cmyk raster and vector objects in a pdf document to a specific cmyk profile in one easy step without converting all of the black text to 4-color process, I am basically screwed. 
    How do I put in a vote to revert to the so-called broken functionality or have it added as an extra functionality in addition to the simple embedding option that you now state this was intended to be for profiles in the same color space.

  • How to preflight a convert colors command

    I can manually convert color spaces per the attached screenshot, but for the life of me I can not figure how to turn this into a batch or preflight in Acrobat 9 or an action or preflight in Acrobat X.  Can someone please help me with this and explain how this can be done?  I can manage to convert the text and lines but the images are not converting like they do when I run it manually.

    I can manually convert color spaces per the attached screenshot, but for the life of me I can not figure how to turn this into a batch or preflight in Acrobat 9 or an action or preflight in Acrobat X.  Can someone please help me with this and explain how this can be done?  I can manage to convert the text and lines but the images are not converting like they do when I run it manually.

Maybe you are looking for