Drawing  text in a jpeg image

Hi,
I want to draw a string in a jpeg image file.The file will contain only that string.Anybody can help me suggesting the best way or any available program is there for it.
Thanks in advance.
Papu

You can use the image functions in PHP to get the size of JPEG, GIF, PNG, SWF, TIFF and JPEG2000 images, and if you have the GD library (available at http://www.boutell.com/gd/) you will also be able to create and manipulate images.
good lock
ciprian
http://www.astroclaire.com

Similar Messages

  • How can I add a title and ALT text to a JPEG image in Elements 11 for MAC?

    Does anyone know if there is an easy way I can add a title and ALT text to a JPEG image in Elements 11 for MAC?
    Very grateful for any help here.

    Hello
    The Arrange menu is your friend.
    You may select the arrow then "Bring to Front".
    Yvan KOENIG (from FRANCE vendredi 19 septembre 2008 17:49:50)

  • Can someone help me with drawing text and a custom image in cocoa?

    I am trying to learn how to draw, and when I look at the tutorial, instead of getting straight to the point on how to draw text at a coordinate, it talks about the concepts of how to draw. I get that, but exactly what methods and what objects should I use?
    For instance, the java code:
    +public void drawComponent(Graphics g){+
    +Graphics2D g2 = (Graphics2D) g;+
    +g2.drawString("Hello, World!", 10, 20);+
    draws the good old "Hello, World!" on a line starting 20 pixels down and 10 pixels across. How would I do the same in objective-c in a customized view? Based on the tutorial, I need specify the code in the
    +- (void)drawRect: (NSRect) rect+
    method.
    Also, how would I draw a picture(.gif and .png format)?

    Here's a very basic example:
    - (void)drawRect:(NSRect)rect {
    // draw text
    NSString *myString = @"Hello World";
    NSFont *font = [NSFont boldSystemFontOfSize:24];
    NSColor *color = [NSColor blueColor];
    NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
    font, NSFontAttributeName,
    color, NSForegroundColorAttributeName,
    nil];
    [myString drawAtPoint:NSMakePoint(20, 0) withAttributes:attrs];
    // draw image
    NSImage *myImage = [NSImage imageNamed:@"picture1.png"];
    [myImage drawAtPoint:NSMakePoint(20, 40)
    fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
    Since the above uses the imageNamed convenience method of NSImage, the arg must be the name of an image file you've previously added to the main bundle (Project->Add to Project). The code for a gif would be exactly the same.
    For more details see [Drawing Images into a View|https://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Coc oaDrawingGuide/Images/Images.html#//apple_ref/doc/uid/TP40003290-CH208-BCIIBDAD] and [Simple Text Drawing|https://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ CocoaDrawingGuide/Text/Text.html#//apple_ref/doc/uid/TP40003290-CH209-SW1] in the +Cocoa Drawing Guide+. Btw, the above is for OS X, since you asked about Cocoa. iPhone code is now called Cocoa Touch, so I hope I guessed the platform right. In case you really wanted iPhone, the code would be quite similar, but you'll need to substitute CGPointMake for NSMakePoint, UIColor for NSColor, UIImage for NSImage, and use a method like [drawAtPoint:forWidth:withFont:minFontSize:actualFontSize:lineBreakMode:baselin eAdjustment:|http://developer.apple.com/iphone/library/documentation/UIKit/Refer ence/NSStringUIKit_Additions/Reference/Reference.html#//appleref/doc/uid/TP40006893-CH3-SW14] for your text. You'll also only need one arg for the [drawAtPoint|http://developer.apple.com/iphone/library/documentation/UIKit/Refe rence/UIImageClass/Reference/Reference.html#//appleref/doc/uid/TP40006890-CH3-SW24] method of UIImage.
    Hope that helps get you started!
    - Ray

  • Editing jpeg image

    I need help editing the text in a jpeg image. The image is hard to read when I add it to my Indesign file.

    Hello and welcome,
    But I think you posted this in the wrong forum. This is one of the Captivate forums, and you are talking about something else.
    JPEG is a compressed bitmap format, you will not be able to edit text in such a format. Do you know the origin? With Photoshop you could sharpen the image, but not sure at all that it will make the text readable, and you will never be able to edit the text. Only applications like Photoshop, when you add text in the application, allow that kind of functionality, but not an output, compressed format like JPEG.
    Lilybiri

  • HELP - CONVERTING A JPEG IMAGE INTO A LINE DRAWING

    PLEEEASE HELP ME!!!
    sorry to be thick - im only a beginner   ---   is there any way to covert a jpeg image into like a line drawing where there is a block colour background and solid lines that make up the picture like you sometimes get in brochures - somthing different to just the effects that are availible in the filter gallery...
    thanks
    LUK

    As far as I recall there's no magic/easy "convert to vector drawing" functionality in Photoshop, though there are some things you can do to help smooth rough edges (e.g., Filter - Noise - Median).  There are also some things you can do, if you want to get fancy, based on converting selections to paths, but that can get kind of involved and likely requires manual path editing afterward.
    I have heard there are some pretty decent vector conversion functions in other Adobe apps...  Adobe Illustrator, perhaps?  Someone who uses Illustrator may want to chime in here; I don't have that package.
    -Noel

  • How draw TEXT to Image

    I have a Image component loaded from file :
    private Image bgImage;
    bgImage           = new ImageIcon("images/BackGround.jpg").getImage();
    And I want draw text to this image.
    How to do it?
    Best Regards.

    Related to this posting:
    http://forum.java.sun.com/thread.jspa?threadID=756975
    It would be nice if the OP will keep all the information together in one place so everybody knows what has already been suggested.

  • How can I quickly add text to a jpeg?

    Hi folks,
    I'd love to be able to just click on a jpeg and then add text to it. Preview Help says I can add text to an image by clicking Annotate and then Text, but I can't get anything to work. What am I doing wrong? Can anyone recommend a quick and easy way to add text to a jpeg?
    TIA,
    Renee

    Renee Clark wrote:
    Preview Help says I can add text to an image by clicking Annotate and then Text, but I can't get anything to work.
    Select the menu option Tools -> Annotate -> Add Text. The cursor should change to a "cross-hair". Use that to draw a rectangle, then type.

  • Improve quality of JPEG images

    Hi
    I have an application which saves images in JPEG format after editing (well, many applications does that, but this is only a fraction of what this application does) :-)
    I can't use any other formats due to size restrictions. The problem is Image Editing module of this application has operations like line drawing and text inserting. When I save the image, fine lines (especially texts) are getting blurred.
    Is there any way I can increase the quality of JPEG files saved? I understand that JPEG is not meant for sharp lines and texts but with Photoshop, even fine lines and texts appear good when saved as a high quality JPEG file. Is there any such method in Java by which I can increase the quality of JPEG images?
    Thanks in advance...

    Is there any way I can increase the quality of JPEG files saved? I understand that JPEG is not meant for sharp lines and texts but with Photoshop, even fine lines and texts appear good when saved as a high quality JPEG file. Is there any such method in Java by which I can increase the quality of JPEG images?I JPEG is a non-conservative compression format (you do not get back exactly what you put in, it has "acceptable degredaton"--I talked with the author before it became popular and he explained what JPEG was all about--high compresses resulting in a small size for internet communications over dialup.
    In more recent times I've seen quality factors brought into play with JPEG, but as you have stated, even in Adobe Photoshop under the highest quality, you still have degradation. I've seen some hint and some state that you can get a lossless JPEG, but I've not encountered it yet.
    In any case, if you do find a "lossless JPEG" the size of that file is going to be bigger than you are looking at now. You may consider other file formats--TIFF or there are even more recent files formats that have higher conservative compression algorithms.

  • I am trying to use photomerge compose.  I open one standard jpeg image and one image that is my business logo in a png format.  When I select the png image, to extract the logo from it, it appears as all white and will not allow me to select the logo from

    I am trying to use photomerge compose.  I open one standard jpeg image and one image that is my business logo in a png format.  When I select the png image, to extract the logo from it, it appears as all white and will not allow me to select the logo from it.  It has worked in the past but I downloaded the update today and photomerge will not work correctly.  Any ideas?

    hedger,
    How do you expect anyone to help when we don't know a darned thing about the file, abut your setup, exact version of Photoshop and your OS, machine specs, etc.?
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Is there a way to turn a text character into an image?

    Is it possible to turn a text character into an image/shape...using Pages or any other iLife or iWorks app?
    Reason being - I want to use a certain font and a character in it, but that particular font is not being recognized/shown properly by another computer. I want to make sure the text character shows up as I intend, and I figure the way to do that is by turning the text character into an image/shape (like a jpeg maybe? or a tiff or gif? I don't know too much about the difference between these last two). Then I can paste that image onto any background and have it still look like text laying on top of the background.
    Hope that makes sense, and many thanks in advance for any insights!

    Although it saves the text character as an image, it also saves the background (the white of the page) as part of that image. So when the character is pasted into a document whose background is anything other than white, it doesn't look like a simple text character anymore. It looks like a white box with a text character in it. You know what I mean?
    I'm thinking I might need to use whole 'nother graphics program to do this whole deal...what do you think?
    Rather than using Preview, create the new image from the clipboard in GraphicConverter & use the transparency wand to make the background transparent. Then use ⌘ E to select just the image & save, choosing to save just the selection.

  • Is there a way to overlay a soundcloud music player widget (flash or HTML5) ON TOP of a jpeg image?

    I am designing my first webpage for a new site. It is very basic in function, where I am going to be embedding a bunch of soundcloud.com players of my music to my website. This part is fairly easy. I currently have Adobe Dreamweaver CS6.
    Since I have ZERO webdesign experience, going the easy route is best. It was suggested to me by someone to create what I wanted my webpage to look like in photoshop (which I have lots of experience in). Essentially, I have a single image with lots of visual information on it, where I can then add "hotspots" if needed. So, I created my design, where there are specific areas ON TOP of the jpeg image where I want to overlay the soundcloud player. I am able to adjust the size, and format (HTML5 or Flash) of the player itself at soundcloud. I then have the proper code that needs to be put where I want it on top of my image.
    Is there a simple piece of code, or a way in Dreamweaver to accomplish this in an easy way?
    Thanks in advance!

    Here is the widget code for HTML5 for the first one:
    <iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F63420632&c olor=c51c64&auto_play=false&show_artwork=false"></iframe>
    Flash if needed:
    <object height="81" width="100%"><param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F63 420632&color=c51c64&auto_play=false&show_artwork=false&show_playcount=true&show_comments=t rue"></param><param name="allowscriptaccess" value="always"></param><embed allowscriptaccess="always" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F63 420632&color=c51c64&auto_play=false&show_artwork=false&show_playcount=true&show_comments=t rue" type="application/x-shockwave-flash" width="100%" height="81"></embed></object><span><a href="http://soundcloud.com/groovefunkel/the-human-league-vs-elo-vs">The Human League vs. ELO vs. Lady Gaga - Don't You Want Me Evil This Way</a> by <a href="http://soundcloud.com/groovefunkel">groovefunkel</a></span>
    Second one: (HTML5)
    <iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F57922474&c olor=c51c64&auto_play=false&show_artwork=false"></iframe>
    Flash:
    <object height="81" width="100%"><param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F57 922474&color=c51c64&auto_play=false&show_artwork=false&show_playcount=true&show_comments=t rue"></param><param name="allowscriptaccess" value="always"></param><embed allowscriptaccess="always" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F57 922474&color=c51c64&auto_play=false&show_artwork=false&show_playcount=true&show_comments=t rue" type="application/x-shockwave-flash" width="100%" height="81"></embed></object><span><a href="http://soundcloud.com/groovefunkel/adele-vs-hall-and-oates-1">Adele vs. Hall and Oates - Maneater Won't Go</a> by <a href="http://soundcloud.com/groovefunkel">groovefunkel</a></span>
    And finally, here is a link to the jpeg image:
    http://www.mediafire.com/view/?z2bngmtiikmi9k9  (only 2mb files were permitted to be uploaded here directly)
    You can probably see where I want the player to overlay...below the text and to the right of the artwork.  I will have the image centered on the screen.
    I greatly appreciate your help!
    Thanks again,
    David

  • I need to edit text in a jpeg file.  How do I do that?

    I need to edit text in a jpeg file.  How do I do that?

    Unfortunately you can't. A JPEG is a flat raster (pixel-based) image file which has no awareness of "text" inside it. You could try to erase the text and graphic under it and then recreate the text, but it's best to do so using a mastering format such as PSD (Photoshop) or PXM (Pixelmator), so that you can export as JPEG but keep your layered master for later editing.
    Matt

  • Email showing up as jpeg image only?  Links inoperative.

    One of the people regularly sending me email recently changed their format. I'm now receiving only a jpeg image of their document. Instead of individual attachments, items now appear in the body of the email with links that do not work. The attachments should be PDF documents that should open in Preview or Acrobat Reader. I contacted the sender and was told they had no idea what's causing the problem. My correspondent said the mails work fine on his iMac. Any ideas?
    Message was edited by: jvlahovich

    My correspondent said the mails work fine on his iMac.
    Of course they work fine on his Mac, because he's not sending email to himself. Your sender probably changed their sending format to Rich Text, as well as selecting Small from the Image Size popup menu in the bottom right corner of the compose window when they attached a PDF file; that would cause Mail to send only a .jpeg of the actual file instead of the actual file.
    Ask them to send Plain Text only, and you should change your format for sending email to Plain Text. You should also ask them to just bundle all images they send into a .zip archive and attach it, and do not select anything other than Actual Size from the Image Size popup menu when attaching any documents or other types of files.
    Mulder

  • Adding Text to a Buffered Image

    Hey
    I am trying to add text to a bufferedimage image and have tried a couple of ways.
    I cannot seem to get it to work propely though. Everytime i try, the text appears but the image appears inside the lettering of the text and not under it like i want it to.
    Could someone please explain the best way of place text on TOP of an image as i am really stuck now :(
    Thanks in advanced for any help

    Basically paint your buffered image into a new BufferedImage and then paint in the new text on top.
    Here's a demo.
    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    public class BufferedImageTest
        public static void main(String[] args)
            ImageGenerator ig = new ImageGenerator();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(ig.getOriginalImagePanel(), "North");
            f.getContentPane().add(ig.getTextPanel(), "South");
            f.setSize(400,640);
            f.setLocation(200,50);
            f.setVisible(true);
            f.getContentPane().add(ig.getNewImagePanel());
            f.validate();
            f.repaint();
    class ImageGenerator
        JPanel originalPanel = new JPanel()
            public void paintComponent(Graphics g)
                super.paintComponent(g);
                Graphics2D g2 = (Graphics2D)g;
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                    RenderingHints.VALUE_ANTIALIAS_ON);
                int w = getWidth();
                int h = getHeight();
                g2.setPaint(Color.blue);
                g2.fill(new Rectangle2D.Double(w/16, h/16, w*7/8, h*7/8));
                g2.setPaint(Color.yellow);
                g2.fill(new Rectangle2D.Double(w/8, h/8, w*3/4, h*3/4));
                g2.setPaint(Color.red);
                g2.fill(new Ellipse2D.Double(w/6, h/6, w*2/3, h*2/3));
                g2.setPaint(Color.green);
                g2.draw(new Line2D.Double(w/16, h/16, w*15/16, h*15/16));
        JPanel textPanel = new JPanel()
            Font font = new Font("lucida sans regular", Font.PLAIN, 32);
            String text = "A New Label";
            public void paintComponent(Graphics g)
                super.paintComponent(g);
                Graphics2D g2 = (Graphics2D)g;
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                    RenderingHints.VALUE_ANTIALIAS_ON);
                g2.setFont(font);
                FontRenderContext frc = g2.getFontRenderContext();
                LineMetrics lm = font.getLineMetrics(text, frc);
                float textWidth = (float)font.getStringBounds(text, frc).getWidth();
                int w = getWidth();
                int h = getHeight();
                float x = (w - textWidth)/2;
                float y = (h + lm.getHeight())/2 - lm.getDescent();
                g2.drawString(text, x, y);
        public ImageGenerator()
            originalPanel.setBackground(Color.white);
            originalPanel.setPreferredSize(new Dimension(300,200));
            textPanel.setOpaque(false);
            textPanel.setPreferredSize(new Dimension(300,200));
        private BufferedImage createNewImage()
            BufferedImage image = new BufferedImage(originalPanel.getWidth(),
                                                    originalPanel.getHeight(),
                                                    BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = image.createGraphics();
            originalPanel.paint(g2);
            textPanel.paint(g2);
            g2.dispose();
            return image;
        public JPanel getOriginalImagePanel()
            return originalPanel;
        public JPanel getTextPanel()
            return textPanel;
        public JPanel getNewImagePanel()
            JPanel panel = new JPanel()
                BufferedImage image = createNewImage();
                public void paintComponent(Graphics g)
                    super.paintComponent(g);
                    Graphics2D g2 = (Graphics2D)g;
                    g2.drawImage(image, null, 0, 0);
            return panel;
    }

  • Problem displaying CMYK jpeg images

    I have a problem with a CMYK jpeg image.
    I know that about supported JPEGs in JRE - JCS_CMYK and JCS_YCCK are not supported directly.
    And I found here how to load the image:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799903
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5100094
    I used both the suggestions described to load it, but when the image is displayed the colors are wrong, are very different from the one displayed in PhotoShop, for example.
    Any suggestion are very appreciated. If it's necessary i can send you the image.
    Roberto
    Here is the code
    package com.cesarer.example.crop;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.util.Iterator;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.ImageInputStream;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class CroppingRaster extends JPanel
        BufferedImage image;
        Dimension size;
        Rectangle clip;
        boolean showClip;
        public CroppingRaster(BufferedImage image)
            this.image = image;
            size = new Dimension(image.getWidth(), image.getHeight());
            showClip = false;
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int x = (getWidth() - size.width)/2;
            int y = (getHeight() - size.height)/2;
            g2.drawImage(image, x, y, this);
            if(showClip)
                if(clip == null)
                    createClip();
                g2.setPaint(Color.red);
                g2.draw(clip);
        public void setClip(int x, int y)
            // keep clip within raster
            int x0 = (getWidth() - size.width)/2;
            int y0 = (getHeight() - size.height)/2;
            if(x < x0 || x + clip.width  > x0 + size.width ||
               y < y0 || y + clip.height > y0 + size.height)
                return;
            clip.setLocation(x, y);
            repaint();
        public Dimension getPreferredSize()
            return size;
        private void createClip()
            clip = new Rectangle(140, 140);
            clip.x = (getWidth() - clip.width)/2;
            clip.y = (getHeight() - clip.height)/2;
        private void clipImage()
            BufferedImage clipped = null;
            try
                int w = clip.width;
                int h = clip.height;
                int x0 = (getWidth()  - size.width)/2;
                int y0 = (getHeight() - size.height)/2;
                int x = clip.x - x0;
                int y = clip.y - y0;
                clipped = image.getSubimage(x, y, w, h);
            catch(RasterFormatException rfe)
                System.out.println("raster format error: " + rfe.getMessage());
                return;
            JLabel label = new JLabel(new ImageIcon(clipped));
            JOptionPane.showMessageDialog(this, label, "clipped image",
                                          JOptionPane.PLAIN_MESSAGE);
        private JPanel getUIPanel()
            final JCheckBox clipBox = new JCheckBox("show clip", showClip);
            clipBox.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    showClip = clipBox.isSelected();
                    repaint();
            JButton clip = new JButton("clip image");
            clip.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    clipImage();
            JPanel panel = new JPanel();
            panel.add(clipBox);
            panel.add(clip);
            return panel;
        public static void main(String[] args) throws IOException
             File file = new File("src/ABWRACK_4C.jpg");
             // Find a JPEG reader which supports reading Rasters.
            Iterator readers = ImageIO.getImageReadersByFormatName("JPEG");
            ImageReader reader = null;
            while(readers.hasNext()) {
                reader = (ImageReader)readers.next();
                if(reader.canReadRaster()) {
                    break;
         // Set the input.
            ImageInputStream input =
                ImageIO.createImageInputStream(file);
            reader.setInput(input);
            Raster raster = reader.readRaster(0, null);
             BufferedImage bi = new BufferedImage(raster.getWidth(),
                    raster.getHeight(),
                    BufferedImage.TYPE_4BYTE_ABGR);
             // Set the image data.
             bi.getRaster().setRect(raster);
            // Cropping test = new Cropping(ImageIO.read(file));
             CroppingRaster test = new CroppingRaster(bi);
            ClipMoverRaster mover = new ClipMoverRaster(test);
            test.addMouseListener(mover);
            test.addMouseMotionListener(mover);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(test));
            f.getContentPane().add(test.getUIPanel(), "South");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class ClipMoverRaster extends MouseInputAdapter
        CroppingRaster cropping;
        Point offset;
        boolean dragging;
        public ClipMoverRaster(CroppingRaster c)
            cropping = c;
            offset = new Point();
            dragging = false;
        public void mousePressed(MouseEvent e)
            Point p = e.getPoint();
            if(cropping.clip.contains(p))
                offset.x = p.x - cropping.clip.x;
                offset.y = p.y - cropping.clip.y;
                dragging = true;
        public void mouseReleased(MouseEvent e)
            dragging = false;
        public void mouseDragged(MouseEvent e)
            if(dragging)
                int x = e.getX() - offset.x;
                int y = e.getY() - offset.y;
                cropping.setClip(x, y);
    }

    The loading process It takes about 10 seconds, and every repaint it takes the same time.The painting yes, the loading no. It shouldn't take much more time to load the image then an ordinary JPEG. In particular, your now using a "natively accelerated" JPEG image reader, so it should take less time on average to load any JPEG. 10 seconds is absurd. Are you sure your not including the drawing time in that figure?
    - Another problem: JAI-ImageIO is not available for MAC OS X platform.This is somewhat true. You can take the imageio.jar file and package it together with your program (adding it to the class path). This will give you most of the functionality of JAI-ImageIO; in particular the TIFFImageReader. You just won't be able to use the two natively accelerated ImageReaders that comes with installing.
    Right now, you're using the accelerated CLibJPEGImageReader to read the image. You can't use this image reader on the MAC, so you have to take the approach mentioned in the 2nd bug report you originally posted (i.e. use an arbitrary CMYK profile).
    The conversion is too long more than 30 seconds.The code you posted could be simplified to
    BufferedImage rgbImage = new BufferedImage(w,h,
                BufferedImage.3_BYTE_BGR);
    ColorConvertOp op = new ColorConvertOp(null);
    op.filter(cmykImage,rgbImage);But again, 30 seconds is an absurd value. After a little preparation, converting from one ICC_Profile to another is essentially a look up operation. What does,
    System.out.println(cmykImage.getColorModel().getColorSpace());print out? If it's not an instance of ICC_ColorSpace, then I can understand the 30 seconds. If it is, then something is dreadfully wrong.
    the RGB bufferedImage that i get after the transformation when it is displayed is much more brightThis is the "one last problem that pops up" that I hinted at. It's because some gamma correction is going on in the background. I have a solution, but it's programming to the implementation of the ColorConvertOp class and not the API. So I'm not sure about its portability between java versions or OS's.
    import javax.swing.*;
    import java.awt.color.ICC_ColorSpace;
    import java.awt.color.ICC_Profile;
    import java.awt.image.BufferedImage;
    import java.awt.image.ColorConvertOp;
    import javax.imageio.ImageIO;
    import java.io.File;
    public class CMYKTest {
         public static void main(String[] args) throws Exception{
            long beginStamp, endStamp;
            //load image
            beginStamp = System.currentTimeMillis();
            BufferedImage img = ImageIO.read(/*cmyk image file*/);
            endStamp = System.currentTimeMillis();
            System.out.println("Time to load image: " + (endStamp-beginStamp));
            //color convert
            BufferedImage dest = new BufferedImage(img.getWidth(),
                                                   img.getHeight(),
                                                   BufferedImage.TYPE_3BYTE_BGR);
            beginStamp = System.currentTimeMillis();
            sophisticatedColorConvert(img,dest);
            endStamp = System.currentTimeMillis();
            System.out.println("Time to color convert: " + (endStamp-beginStamp));
            //display
            JFrame frame = new JFrame();
            frame.setContentPane(new JScrollPane(new JLabel(new ImageIcon(dest))));
            frame.setSize(500,500);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
        public static BufferedImage sophisticatedColorConvert(BufferedImage src,
                                                              BufferedImage dst) {
            ICC_ColorSpace srcCS =
                    (ICC_ColorSpace) src.getColorModel().getColorSpace();
            ICC_Profile srcProf = srcCS.getProfile();
            byte[] header = srcProf.getData(ICC_Profile.icSigHead);
            intToBigEndian(ICC_Profile.icSigInputClass,header,12);
            srcProf.setData(ICC_Profile.icSigHead,header);
            ColorConvertOp op = new ColorConvertOp(null);
            return op.filter(src, dst);
        private static void intToBigEndian(int value, byte[] array, int index) {
                array[index]   = (byte) (value >> 24);
                array[index+1] = (byte) (value >> 16);
                array[index+2] = (byte) (value >>  8);
                array[index+3] = (byte) (value);
    }

Maybe you are looking for

  • Nokia 2330

    I have friend in South Africa and he ask me if he can install skype in his 2330 classic cell phone?

  • Additional Pricing Condition Type Determination in Returns Oder

    Hi Guys I am working on Returns Sales Process, but I have stuck in pricing? The thing is I have to determine the additional condition type based on transaction type .i.e. returns order when I create the returns order with ref. to sales order the pric

  • Copy data of posting level greater 10 in EHP2

    Dear all,    We install EHP2 ( enhancement package 2 ) to our BCS.    According to the document , we should be able to copy data with posting level >10.    We are trying to copy data(all data types) from one group currency to another one.    First ,w

  • EDI output

    Hi All, We are trying to trigger an EDi output but get an error while doing so as given below Maintain outgoing EDI-connection data for partner 14470 What is this? Where to maintain it? Regards, V S

  • EPrint Portal Feature Request - Discarded Messages Email Address

    When a user has the ePrint Center site configured to only allow printing from allowed email addresses, the site displays emails that have been discarded because they are not on the approved sender list.  Feature Request: Please consider changing the