15 Replies Latest reply on Aug 4, 2009 8:09 AM by Jacob Bugge

    Pasted bitmaps have odd sizes

    RandomDS Level 1

      When I paste a bitmap (i.e., a rectangular selection) from Photoshop CS4 into Illustrator CS4, the bitmap ends up with a strange size in Illustrator. For example, I just copied a 16x16 pixel selection from Photoshop, and it ended up being 15.998x15.998 pixels in Illustrator. Both the Photoshop and Illustrator documents are set to 72 dpi, and use pixel units.

       

      Is there a reasonable explanation for this behavior? Is there any way to get bitmaps to paste into Illustrator with their correct (original) pixel size?

        • 1. Re: Pasted bitmaps have odd sizes
          Mylenium Most Valuable Participant

          In Photoshop, set your Units & Rulers Point/Pica settings to traditional. AI does not use the simplified PostScript math. If you will, it is over-precise, which of course makes sense - in a vector world, values do not necessarily have to adhere to a pixel grid like they need to in PS.

           

          Mylenium

          • 2. Re: Pasted bitmaps have odd sizes
            Jacob Bugge MVP & Adobe Community Professional

            Random,

             

            Adding to what Lutz said, you may change the values to integers in the Transform palette, with the image selected.

            • 3. Re: Pasted bitmaps have odd sizes
              RandomDS Level 1

              Mylenium,

               

              Thanks for the quick reply. Unfortunately, I tried what you suggested, and it made no difference to the behavior I'm seeing. I even restarted Photoshop after making the change to "Traditional" and started a new document.

               

              Just to be clear, here are the steps I'm taking:

               

              1. Use Alt+PrintScreen to screen-snap a window on my system.

              2. In Photoshop, do New Document and use the Clipboard preset.

              3. Paste the screen snap into my new Photoshop document.

              4. Make a 16x16 pixel rectangular selection in Photoshop and copy it to the clipboard.

              5. Go to an empty document in Illustrator.

              6. Paste the bitmap into Illustrator. In the toolbar, it says: Image Embedded RGB PPI:72.009 W:15.998 H:15.998

              7. Click the Image link in the toolbar, and go to the Link Information dialog. It says: Transform: Scale: 99.988%, 99.988%

              8. Resize the bitmap to 16x16 pixels. PPI now changes to 72, and the Link Information dialog now says Scale: 100%, 100%.

               

              I get the same result whether I set Photoshop's "Point/Pica Size" setting to PostScript (72) or to Traditional (72.27).

               

              Since both Photoshop and Illustrator are set to 72 pixels per inch, why can't Illustrator get the size exactly right? I understand that I can manually resize the bitmap to 16x16 pixels, but that's annoying. These products are supposed to be part of an integrated suite; they should work better together than this.

               

              - Rand

              • 4. Re: Pasted bitmaps have odd sizes
                Jacob Bugge MVP & Adobe Community Professional

                Random,

                 

                What happens if you skip Photoshop and paste the screenshot into Illy?

                 

                And why go through Photoshop in the first place?

                 

                Occasionally, I paste screenshots into Illy, and I have never seen anything like your issue, but then again, I am still with 10.

                • 5. Re: Pasted bitmaps have odd sizes
                  RandomDS Level 1

                  If I paste the screenshot directly into Illustrator, it has the correct size, and PPI is 72, and the Link Information dialog shows Scale of 100%. I also get the correct behavior if I paste from other Windows apps, for example IrfanView. The messed-up size only seems to happen if I paste from Photoshop.

                   

                  As I mentioned, the reason I go into Photoshop first is that I need to copy one or more specific PARTS of the screenshot, not the whole thing.

                  • 6. Re: Pasted bitmaps have odd sizes
                    Jacob Bugge MVP & Adobe Community Professional

                    Random,

                     

                    Please forgive the possible silliness of the question:

                     

                    Why not just select the desired part in Illy, and either:

                     

                    1) Create a Clipping Mask, preferably doing away with the outlying parts, with the masked image selected, by:

                    1a) Ticking anything but Normal in the Transparency dropdown list,

                    1b) Object>Flatten Transparency; you may keep the Raster/Vector balance at full vector,

                     

                    Or:

                     

                    2) Set the Crop Marks/Crop Area/Artboard/whatever, depending of version, before saving/exporting?

                    • 7. Re: Pasted bitmaps have odd sizes
                      RandomDS Level 1

                      Damn, that was one silly question.

                       

                      Even with Illustrator screwing up the bitmap size, it's still MUCH quicker to just select what I want in Photoshop and copy/paste it into Illustrator, than any of the alternatives provided by Illustrator. My understanding is that it's more efficient too, since Illustrator doesn't have to carry around the rest of the bitmap (the 99.99% I'm not interested in).

                       

                      But please, let's not get sidetracked. I just want Illustrator to do the right thing when I paste a bitmap from Photoshop... since they are, after all, part of the same suite.

                      • 8. Re: Pasted bitmaps have odd sizes
                        Jacob Bugge MVP & Adobe Community Professional

                        Sorry, Random.

                         

                        However,

                         

                        My understanding is that it's more efficient too, since Illustrator doesn't have to carry around the rest of the bitmap (the 99.99% I'm not interested in).

                         

                        1a) and 1b) form a way to get rid of the 99.99%, with less effort than using two applications and correcting the size, I believe.

                         

                        This is not written in defence of application shortcomings.

                        • 9. Re: Pasted bitmaps have odd sizes
                          RandomDS Level 1

                          Of course I was just kidding on the silly part. I appreciate your help, really!

                           

                          I'm not using two applications, I'm using one suite.

                           

                          I didn't know that the Flatten Transparency trick would get rid of the excess parts of the bitmap. (I knew the clipping mask alone doesn't do it.) So I've already learned something new! But... it still seems much more intuitive to me to do bitmap stuff in Photoshop (including selecting parts of a bitmap) and vector stuff in Illustrator. I have both of them open anyway, when I'm doing this type of work.

                          • 10. Re: Pasted bitmaps have odd sizes
                            Mylenium Most Valuable Participant

                            Have you adjusted PS' "New Document" DPI to match your screen DPI? This could be another reason why PS may think it needs to do some magic. Also make sure to select at 100% zoom and no feathering is active somewhere. Since PS is sub-pixel precise, even the slightest offset would force it to take across those sub-pixels/ round them off, in turn resulting in a crooked value conversion in AI. Normal image viewers/converters do not care for sub-pixels, hence the problem doesn't occur.

                             

                            Mylenium

                            • 11. Re: Pasted bitmaps have odd sizes
                              RandomDS Level 1

                              I thought you might be on to something there... and it DID have an effect, but not the one we're hoping for.

                               

                              I set my Photoshop DPI to my screen DPI of 96 and created a new document. I then went through the same routine, and now the pasted bitmap shows in Illustrator as PPI: 96.016. When I "fix" the width and height, the PPI changes to 96. (The width and height are also scaled by 0.75, which is what you'd expect.)

                               

                              Interesting: The error amount,  0.016 is 1/6000 of 96. The error amount for 72 DPI was 0.009, which is 1/8000 of 72. Those are awfully round numbers. I wonder what this means...

                               

                              So Illustrator is getting, via the clipboard, the source DPI from Photoshop -- even when it's different from Illustrator's DPI -- but it isn't getting the correct value. For some bizarre reason, it's getting adjusted a tiny bit. I'm willing to bet that if the DPI came in correctly from Photoshop, the bitmap width and height would be correct too.

                              • 12. Re: Pasted bitmaps have odd sizes
                                Mylenium Most Valuable Participant

                                It should. The one question we have overlooked so far: Is your AI target document actually 72/ 96 DPI? If not, AI would still do some fancy math, as all its calculations are based on point measures...

                                 

                                Mylenium

                                • 13. Re: Pasted bitmaps have odd sizes
                                  Jacob Bugge MVP & Adobe Community Professional

                                  Is your AI target document actually 72/ 96 DPI?

                                   

                                  If not, when set in points or pixels, someone else has overlooked something in creating the application/version.

                                   

                                  So the question may be: Is your File>Document Setup Randomly set to something else? If so, try points/pixels.

                                   

                                  And quick, before someone complains: it is PPI.

                                  • 14. Re: Pasted bitmaps have odd sizes
                                    RandomDS Level 1

                                    Let me make sure we're talking about the same thing: When I create my new AI document, in the New Document dialog, Units is set to "Pixels", and Raster Effects is set to "Screen (72 ppi)". These are the settings I always use.

                                     

                                    Is there anywhere else that I need to set PPI to 72?

                                    • 15. Re: Pasted bitmaps have odd sizes
                                      Jacob Bugge MVP & Adobe Community Professional

                                      We are, Random. I was referring to the Document Setup unit (as it was called in 10); that should be sufficient.

                                       

                                      So I believe that was just one thing less to try/rule out.