Bitshift when resizing image

I found the following code on http://developers.sun.com/techtopics/mobility/reference/techart/design_guidelines/image_resizing.html, and it works great for resizing an image.
In an effort to fully understand what is going on, can someone please explain to me what the bitshift that occurs below do. I understand what happens in a bitshift, but I do not know why the author used a left shift of 16 to establish the ratio for the width and height. Is there something significant about a left shift of 16?
  * This methog resizes an image by resampling its pixels
  * @param src The image to be resized
  * @return The resized image
  private Image resizeImage(Image src) {
      int srcWidth = src.getWidth();
      int srcHeight = src.getHeight();
      Image tmp = Image.createImage(screenWidth, srcHeight);
      Graphics g = tmp.getGraphics();
      int ratio = (srcWidth << 16) / screenWidth;
      int pos = ratio/2;
      //Horizontal Resize       
      for (int x = 0; x < screenWidth; x++) {
          g.setClip(x, 0, 1, srcHeight);
          g.drawImage(src, x - (pos >> 16), 0, Graphics.LEFT | Graphics.TOP);
          pos += ratio;
      Image resizedImage = Image.createImage(screenWidth, screenHeight);
      g = resizedImage.getGraphics();
      ratio = (srcHeight << 16) / screenHeight;
      pos = ratio/2;       
      //Vertical resize
      for (int y = 0; y < screenHeight; y++) {
          g.setClip(0, y, screenWidth, 1);
          g.drawImage(tmp, 0, y - (pos >> 16), Graphics.LEFT | Graphics.TOP);
          pos += ratio;
      return resizedImage;
  }//resize image   

There are so many things this could be, would help if you post a screenshot, and you get a better response on these forums.
Are you using a thin font? 30 pixels is not very much, and you often want to thicken up a font so you get atleast 1 pixel. Try a different aliasing setting?
Do you have any layer effects, you can use layer >> layer Style >> scale effects

Similar Messages

  • Preview changes RGB values when resizing images

    Since I upgraded to snow leopard, preview increases the Red spectrum when resizing images (png). Is this a bug or do I need to change a setting to preserve the original RGB values?

    Figured it out. It seems that when you don't specify the BufferedImage that the operation will write too it changes the type to something it uses for the operation. This still seems like it should be a bug to me, but i got around it by doing this:
    BufferedImage tempIMG = new BufferedImage((int)(srcImg.getWidth()*scale),(int)(srcImg.getHeight()*scale),srcImg.getType());
    op.filter(srcImg, tempIMG);
    return tempIMG.

  • "process mutiple files" freezes computer when resizing images.PSE3

    This function has always worked perfectly for me for years. It started about 2 weeks ago and I have no clue why it is doing this.
    Whenever I try to resize a folder containing mutiple or even single images, it freezes the program and computer until I restart everything.
    More specifics;
    files are being downsized not upsized.
    the original image loads into the program, then as it is being resized, it freezes up at the same point each time. This is when the "progress bar" (not sure of exact name) at the bottom of the page shows about 25% progress.
    I have cleaned up the hard drive and done a file reorganization.
    I have uninstalled and reinstalled the program.
    I can resize images directly through the image/resize function one at a time. The problem is that I frequently have to resize large batches of images.
    Thanks for any help.
    Dave

    Dave
    This has caught other people. Check you Resize Image box to see if some strange value has been entered. One user had accidentally entered 4 pixels instead of 4 inches so all his pictures came out really small. I wonder if you have the opposite problem and are resaving to some extremely large size that Elements does not like.
    If not post back.
    Additional question-are you having problems with the same set of pictures? If so, could you run a test on a second set of pictures. Perhaps there is something strange in the source files.

  • How does one set the DPI when resizing images in Bridge?

    I am sure I am missing something here (so excuse me if its a simple answer) but I am used to using Photo Mechanic and there you are able to set lots of variables while resizing.  I don't understand this Bridge resizing window when using Batch Processing thru Photoshop. 
    -There are two boxes for sizing.  If you put the same dimension in both does it just set the longest dimension to that size?
    -What if I want say a 10x10 inch image at 72 DPI for web use as opposed to a 10 x10 inch image at 300 DPI for printing purposes, where does one enter that info?
    Thanks,
    Joshua

    You don't "resize" anything in Bridge, nor does it set PPI, pixels per inch—and most certainly NOT "DPI" (Dots [of ink] Per Inch) which is exclusively a feature of the printer.
    Bridge is just a File Browser.  It used to be called simply the Photoshop File Browser".  It doesn't open, edit, manipulate resize or even save anything.
    It merely hands the file(s) over to the appropriate application, whether that be Photoshop, adobe Camera Raw, Illustrator, InDesign or even MS Word.
    You wrote:
    -What if I want say a 10x10 inch image at 72 DPI for web use as opposed to a 10 x10 inch image at 300 DPI for printing purposes, where does one enter that info?
    Again, you mean PPI in both instances there.
    You enter that in whatever application you're sending the image from Bridge.
    For instance in Photoshop:

  • Lightroom 5.6 cc glitch when resizing.

    Hi everyone, can anyone help with the glitch that occurs when resizing images. When I click an edge to make an image smaller or rotate, the image zooms out then zooms in again. Its not affecting the tool or the program but is very annoying when handling a lot of files. Thanks!

    Hi everyone, can anyone help with the glitch that occurs when resizing images. When I click an edge to make an image smaller or rotate, the image zooms out then zooms in again. Its not affecting the tool or the program but is very annoying when handling a lot of files. Thanks!

  • Getting black image when resize to thumbnail

    When uploading images through a servlet via a webbrowser, I am saving the image to the harddrive and then resizing the image as thumbnail for certain view pages.
    I have tried serveral approaches to resizing the image, with all solutions I use the thumbnail image is being returned as a solid back image.
    I started with the example on the Sun Tech Tips site: http://java.sun.com/developer/TechTips/1999/tt1021.html
        public static void createThumbnail(
                String orig, String thumb, int maxDim) {
            try {
                // Get the image from a file.
                Image inImage = new ImageIcon(orig).getImage();
                // Determine the scale.
                double scale = (double) maxDim / (double) inImage.getHeight(null);
                if (inImage.getWidth(null) > inImage.getHeight(null)) {
                    scale = (double) maxDim / (double) inImage.getWidth(null);
                // Determine size of new image. One of them
                // should equal maxDim.
                int scaledW = (int) (scale * inImage.getWidth(null));
                int scaledH = (int) (scale * inImage.getHeight(null));
                // Create an image buffer in which to paint on.
                BufferedImage outImage = new BufferedImage(scaledW, scaledH,
                        BufferedImage.TYPE_INT_RGB);
                // Set the scale.
                AffineTransform tx = new AffineTransform();
                // If the image is smaller than the desired image size,
                // don't bother scaling.
                if (scale < 1.0d) {
                    tx.scale(scale, scale);
                // Paint image.
                Graphics2D g2d = outImage.createGraphics();
                g2d.drawImage(inImage, tx, null);
                g2d.dispose();
                // JPEG-encode the image and write to file.
                OutputStream os = new FileOutputStream(thumb);
                JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
                encoder.encode(outImage);
                os.close();
            } catch (IOException e) {
                e.printStackTrace();
        }I have tried other approaches from various posting I found off google such as:
        public static void scale(String filename, String outputfile, int width, int height)
                throws Exception {
            ImageIcon source = new ImageIcon(filename);
            double sf_x = width / (double) source.getIconWidth();
            double sf_y = height / (double) source.getIconHeight();
            System.err.println("Scale_factor_X: " + sf_x);
            System.err.println("Scale_factor_Y: " + sf_y);
            BufferedImage bufimg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
            Graphics2D g = bufimg.createGraphics();
            g.setComposite(AlphaComposite.Src);
            AffineTransform aft = AffineTransform.getScaleInstance(sf_x, sf_y);
            g.drawImage(source.getImage(), aft, null);
            FileOutputStream os = new FileOutputStream(outputfile);
            JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder(os);
            enc.encode(bufimg);
            os.flush();
            os.close();
        }No matter the implementation, the output is always the black image. I tried additional steps such as adding the JVM flag of:
    -Djava.awt.headless=true
    I've certainly spent a few hours on the google search engine and reviewing various newgroup posting, your suggestions come with many thanks.
    Cheers,
    Justen

    I tried your method and it worked okay. The only way I can get the black image is to send in a distorted path. One of the problems with the ImageIcon.getImage technique is that you get no feedback about loading failure. Here's a way to peek into the process for some indication of how it went. If you can tolerate j2se 1.4+ you could use the ImageIO methods in lieu of the proprietary JPGImageEncoder.
    import com.sun.image.codec.jpeg.*;
    import java.awt.*;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class ImageScalingTest extends JPanel
        public static void createThumbnail(
                String orig, String thumb, int maxDim) {
            try {
                // Get the image from a file.
                ImageIcon icon = new ImageIcon(orig);
                int status = icon.getImageLoadStatus();
                String s = "";
                switch(status)
                    case MediaTracker.ABORTED:
                        s = "ABORTED";
                        break;
                    case MediaTracker.ERRORED:
                        s = "ERRORED";
                        break;
                    case MediaTracker.COMPLETE:
                        s = "COMPLETE";
                System.out.println("image loading status: " + s);
                Image inImage = icon.getImage();
    //            Object o = ImageScalingTest.class.getResource(orig);
    //            /*Buffered*/Image inImage = ImageIO.read(((URL)o).openStream());
                // Determine the scale.
                double scale = (double) maxDim / (double) inImage.getHeight(null);
                if (inImage.getWidth(null) > inImage.getHeight(null)) {
                    scale = (double) maxDim / (double) inImage.getWidth(null);
                // Determine size of new image. One of them
                // should equal maxDim.
                int scaledW = (int) (scale * inImage.getWidth(null));
                int scaledH = (int) (scale * inImage.getHeight(null));
                // Create an image buffer in which to paint on.
                BufferedImage outImage = new BufferedImage(scaledW, scaledH,
                        BufferedImage.TYPE_INT_RGB);
                // Set the scale.
                AffineTransform tx = new AffineTransform();
                // If the image is smaller than the desired image size,
                // don't bother scaling.
                if (scale < 1.0d) {
                    tx.scale(scale, scale);
                // Paint image.
                Graphics2D g2d = outImage.createGraphics();
                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                     RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                g2d.drawImage(inImage, tx, null);
                g2d.dispose();
                // JPEG-encode the image and write to file.
                OutputStream os = new FileOutputStream(thumb);
                JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
                encoder.encode(outImage);
                os.close();
    //           ImageIO.write(outImage, "jpg", new File(thumb));
            } catch (IOException e) {
                e.printStackTrace();
        public static void main(String[] args)
            String path = "images/cougar.jpg";
            String fileName = "imageScalingTest.jpg";
            int size = 75;
            ImageScalingTest test = new ImageScalingTest();
            test.createThumbnail(path, fileName, size);
    }

  • When I resize image, The image lose thier shape & align.

    illustrator cs6
    OS : windows 7 32 bit
    CPU : interl(R) Xeon(R) CPU E5462 @ 2.80GHz 2.79GHz
    Memory : 4Gb
    VGM :  ATI Radeon HD 2600 XT 256 MB
    when I resize image, I press shift & alt button.
    and all image were outline stroked.

    it means
    edit -> preferences -> general
        -> uncheck the Scale Storkes & Effects
    windows -> transform -> (show options)
        -> uncheck the Align to Pixel Grid
    thanks larry.

  • Need help on quality of resized image!!

    I am required to resize images to max 1240pixel (longest dimension) as a submission of work, though when work is viewed it will be at 30"x40".  Can not figure out a way to do this where images don't become quite pixelated when viewed at larger size.   Appreciate any suggestions. 

    Is there some software to verify if my graphics card is shotty?
    Techtool Pro has some testing, the AHT tests VRAM, but game benchmarks and stressing will tell you the most.
    Is re-seating the graphics card or memory worth trying?
    Absolutely. Just don't reinstall the graphics card until you clean it thoroughly.
    Cleaning the dust out of my machine?
    YES. A dust filled graphics card heatsink will cause the GPU to cook, and cause problems thet you describe.
    If I need a new graphics card, what are my options? Do I have to purchase it via Apple store? I would like to stick with an Nvidia card so am I stuck buying the same card I currently have or can I upgrade?
    You don't have to buy from Apple, but using with OS X limits your choices to Mac compatible or flashable PC versions.
    There is an awful lot of user input into this topic here:
    http://blog.macsales.com/602-testing-those-new-graphics-cards
    Card reviews can also help:
    http://www.anandtech.com/video/showdoc.aspx?i=3140&p=9
    http://www.tomshardware.com/reviews/radeon-hd-4870,1964.html

  • I need some help resizing my images on PS6. I am using a mac and have been trying to resize with same resolution and constaining proportions but for some reaseon the smaller resized image appears pizelated.

    I need some help resizing my images on PS6. I am using a mac and have been trying to resize with same resolution and constaining proportions but for some reaseon the smaller resized image appears pizelated. Heres an image of before and after. The first image I use is a JPG 72dpi 1500px x1500px and I want to downsize it to 600x600px same res, but it keeps pixelating, this has never happened before. Any suggestions, thoughts?
    thanks!

    I wouldn't say pixelated; more like blurry.
    Like ConnectedCreative said, what steps are you using? Are you using "bicubic sharper" when resizing down?

  • Upload and Resize Image not inserting filename in database

    I have a form that I created using the insert record form wizard. One of the fields is a file field and my form enctype is set to multipart/form-data. I then used the upload and resize image behavior and set the parameters. When testing the form the file uploads to the correct directory but no entry is made into the database for that particular field. The other fields are entered into the database just fine. If it helps, here is the code generated before the  tag:
    <br />
    <br /><?php require_once('../../Connections/test.php'); ?>
    <br /><?php<br />// Load the common classes<br />require_once('../../includes/common/KT_common.php');<br /><br />// Load the tNG classes<br />require_once('../../includes/tng/tNG.inc.php');<br /><br />// Make a transaction dispatcher instance<br />$tNGs = new tNG_dispatcher("../../");<br /><br />// Make unified connection variable<br />$conn_test = new KT_connection($test, $database_test);<br /><br />// Start trigger<br />$formValidation = new tNG_FormValidation();<br />$tNGs->prepareValidation($formValidation);<br />// End trigger<br /><br />//start Trigger_ImageUpload trigger<br />//remove this line if you want to edit the code by hand <br />function Trigger_ImageUpload(&$tNG) {<br />  $uploadObj = new tNG_ImageUpload($tNG);<br />  $uploadObj->setFormFieldName("picture");<br />  $uploadObj->setDbFieldName("picture");<br />  $uploadObj->setFolder("../images/");<br />  $uploadObj->setResize("true", 120, 0);<br />  $uploadObj->setMaxSize(1500);<br />  $uploadObj->setAllowedExtensions("gif, jpg, jpe, jpeg, png, bmp");<br />  $uploadObj->setRename("auto");<br />  return $uploadObj->Execute();<br />}<br />//end Trigger_ImageUpload trigger<br /><br />// Make an insert transaction instance<br />$ins_team = new tNG_insert($conn_test);<br />$tNGs->addTransaction($ins_team);<br />// Register triggers<br />$ins_team->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1");<br />$ins_team->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);<br />$ins_team->registerTrigger("END", "Trigger_Default_Redirect", 99, "../team.php");<br />$ins_team->registerTrigger("AFTER", "Trigger_ImageUpload", 97);<br />// Add columns<br />$ins_team->setTable("team");<br />$ins_team->addColumn("id", "NUMERIC_TYPE", "POST", "id");<br />$ins_team->addColumn("sort", "NUMERIC_TYPE", "POST", "sort");<br />$ins_team->addColumn("name", "STRING_TYPE", "POST", "name");<br />$ins_team->addColumn("title", "STRING_TYPE", "POST", "title");<br />$ins_team->addColumn("description", "STRING_TYPE", "POST", "description");<br />$ins_team->addColumn("picture", "FILE_TYPE", "FILES", "picture");<br />$ins_team->setPrimaryKey("id", "NUMERIC_TYPE");<br /><br />// Execute all the registered transactions<br />$tNGs->executeTransactions();<br /><br />// Get the transaction recordset<br />$rsteam = $tNGs->getRecordset("team");<br />$row_rsteam = mysql_fetch_assoc($rsteam);<br />$totalRows_rsteam = mysql_num_rows($rsteam);<br />?>

    If the reason is about memory, warning message should be happened when upload the image, because "show thumbnail" means resize at second time, how come you failed to resize the picture that system let it upload succeed at the first time by the same resize process?
    upload procedure
    a.jpg: 2722x1814, 1.2mb
    upload condition: fixed width 330px, 1.5mb
    "upload and resize" a.jpg -> file upload -> "resize engine" -> passed (but not work and no warning message)
    "show thumbnail" a.jpg -> "resize engine" -> failed (not enough memory)
    it doesn't make sense.
    and you miss an important key point, I upload the same picture myself, and resize work, so I said it happened at random, and that's why I am so worried.

  • Cannot resize image

    I opened up PSE 4.0 today and I resized an image and it said that it was resized (6x9 became 5x7, for example), but when I dragged it to my project, it was still the same size (not smaller)! Prior to today, it has always been the size that I wanted it to be. I have not changed anything in PSE so I am wondering if anyone knows how to fix this so I can resize images again.
    Thanks so much!

    Hey Erica,
    You can resize the image using the move tool even after placing it in the project.
    Cheers,
    Chhaya

  • How to resize Image Jpeg ?

    I have a problem when I scale file image Jjpeg.
    My code :
    public void resize(Image img){
    BufferredImage bimg = toBufferedImage(img);
    AffineTransform tx = new AffineTransform();
    tx.scale(125,125);
    AffineTransformOp op = new AffineTransformOp (tx,AffineTransformOp.TYPE_BILINEAR)
    bimg = op.filter(bimg, null);
    public static BufferedImage toBufferedImage(Image image) {
    if (image instanceof BufferedImage) {
    return (BufferedImage)image;
    // Determine if the image has transparent pixels; for this method's
    // implementation, see e661 Determining If an Image Has Transparent Pixels
    boolean hasAlpha = hasAlpha(image);
    // Create a buffered image with a format that's compatible with the screen
    BufferedImage bimage = null;
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    try {
    // Determine the type of transparency of the new buffered image
    int transparency = Transparency.OPAQUE;
    if (hasAlpha) {
    transparency = Transparency.BITMASK;
    // Create the buffered image
    GraphicsDevice gs = ge.getDefaultScreenDevice();
    GraphicsConfiguration gc = gs.getDefaultConfiguration();
    bimage = gc.createCompatibleImage(
    image.getWidth(null), image.getHeight(null), transparency);
    } catch (HeadlessException e) {
    // The system does not have a screen
    if (bimage == null) {
    // Create a buffered image using the default color model
    int type = BufferedImage.TYPE_INT_RGB;
    if (hasAlpha) {
    type = BufferedImage.TYPE_INT_ARGB;
    bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
    // Copy image to buffered image
    Graphics g = bimage.createGraphics();
    // Paint the image onto the buffered image
    g.drawImage(image, 0, 0, null);
    g.dispose();
    return bimage;
    }

    This is my code :
    private ImageIcon getImageIcon(String path){
    ImageIcon iIcon = new ImageIcon(path);
    if(iIcon.getIconHeight() > 125 || iIcon.getIconWidth() > 125){
    Image img = iIcon.getImage();
    int iw = img.getHeight(null);
    int ih = img.getWidth(null);
    BufferedImage bImage1 = toBufferedImage(img);
    BufferedImage bImage2 = new BufferedImage(400,400,1);
    AffineTransform tx = new AffineTransform();
    tx.scale(400,400);
    AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
    BufferedImage bImage3 = op.filter(bImage1, bImage2);
    img = Toolkit.getDefaultToolkit().createImage(bImage2.getSource());
    return (new ImageIcon(img));
    if(iIcon == null)
    return null;
    return iIcon;
    public static BufferedImage toBufferedImage(Image image) {
    if (image instanceof BufferedImage) {
    return (BufferedImage)image;
    // Determine if the image has transparent pixels; for this method's
    // implementation, see e661 Determining If an Image Has Transparent Pixels
    boolean hasAlpha = hasAlpha(image);
    // Create a buffered image with a format that's compatible with the screen
    BufferedImage bimage = null;
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    try {
    // Determine the type of transparency of the new buffered image
    int transparency = Transparency.OPAQUE;
    if (hasAlpha) {
    transparency = Transparency.BITMASK;
    // Create the buffered image
    GraphicsDevice gs = ge.getDefaultScreenDevice();
    GraphicsConfiguration gc = gs.getDefaultConfiguration();
    bimage = gc.createCompatibleImage(
    image.getWidth(null), image.getHeight(null), transparency);
    } catch (HeadlessException e) {
    // The system does not have a screen
    if (bimage == null) {
    // Create a buffered image using the default color model
    int type = BufferedImage.TYPE_INT_RGB;
    if (hasAlpha) {
    type = BufferedImage.TYPE_INT_ARGB;
    bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
    // Copy image to buffered image
    Graphics g = bimage.createGraphics();
    // Paint the image onto the buffered image
    g.drawImage(image, 0, 0, null);
    g.dispose();
    return bimage;
    When I recieve Img3 which is not same original Image (img1)
    Please help me ?

  • Why do my resized images print out original size?

    i understand how to resize images (somewhat). however, when i print them, they are printing as original size. what do i have to do to correct this? i have searched the web in vain, am just not finding info. everything is about resizing only. i am using picture manager. have also tried with paint and photo gallery or something. no one in this house is very computer saavy, PLEASE HELP!!!

    Thankyou for your response! Still in need of help!  
               I am making a craft project. I have resized my image exactly how i want it to be to fit my project base. (No standard sizes work). I made the image smaller, to fit exactly on my base (a heart). I saw there were even templates with a heart, but have not figured that out yet. I used the percentage button to resize my image, with the ratio set to keep the dimensions correct. I saved the resized image. Then I opened it and printed it. It was smaller, but still not right, not how I have it on the screen and not the right size. It is too big for my heart and wouldn't work. I know it must be something simple, some little step I am missing. I need to know how to tell the printer the new size. I am using picture manager. I have a HP Photosmart Plus B210 series printer. I have picture manager, paint, hp photo viewer, windows photo viewer, media center, photo gallery. I don't understand why resizing, saving, then opening that file, still did not work. It still printed out (smaller than original but) not the size I needed. I also edited the image and saved it with a new size, and my editing changes.
           This is truly driving me insane! I have spent hours and hours trying to figure it out for myself, as well as searching the web, and asking for help from different forums. (Not to mention wasting lots of ink!??!!!!)
                                                         I Truly would appreciate any help,
                                                                          SINCERELY,
                                                                          lamblovegirl    

  • Aliasing when resizing 1080p to 720p

    I can't wrap my head around this, maybe you can.
    Original source video:
    Prores 422
    1920x1080 square pixels
    29.97
    Destination encoding:
    H.264
    1280x720 square pixels
    29.97
    3000kbps
    When I do this, there is severe aliasing, especially on text. However if I use the exact same settings, but encode to 50% of original size (960x540) there aren't any problems at all.
    My best guess is that because 1280x720 is 2/3 of 1920x1080 there is some weird calculating going on that causes this problem. To be honest, it doesn't even look like aliasing, it just looks crummy. Diagonal edges are jagged and uneven.
    In fact, the same thing happens if I downsize using ProRes 422 HQ (same codec as original source).
    Any ideas?
    Message was edited by: revrevrev

    Use the resize image command, set the resampling mode to "nearest neighbor".

  • Resized images are not anti-aliased

    I'm creating an app with html + js + css + air, and I'm doing
    something like this:
    <img src="
    http://somedomain.com/image.jpg"
    />
    I find that if I set the image height/width in css that when
    the image loads it displays in very poor quality, mainly it looks
    like it's not anti-aliased. The images look fine when I don't set a
    height or width, so the images look fine by themselves, and when
    rendered at their original size. It's only when I try to resize it
    that it looks bad.
    Any help is greatly appreciated - many thanks.

    Thanks for the suggestion zorglub76. Perhaps I could find a
    solution resizing the image in actionscript, but then I'm stuck
    with another problem, which is how to take an image I've
    manipulated in AS3 and render it in the html img tag? I'm
    dynamically pulling images from amazon, so I can't resize them
    ahead of time.
    As far as the css goes, I don't believe that's the problem.
    When I take the same html + css and render it in chrome, firefox,
    or safari the smaller image looks great. It's only a problem in
    adobe air, and I believe it has to do with it not being
    anti-aliased.

Maybe you are looking for