16 Replies Latest reply on Apr 22, 2010 3:51 AM by Jacob Bugge

    imported jpg, how to "crop" or round corners

    paperslide Level 1

      So I have this jpg, a scanned image really.. And what I'd like to keep of the scanned image is a square within with rounded corners (within the rectangular scanned image). What's the procedure?

       

      Created and placed a square, corners with a radius over the target and attempted to "divide objects below", of course the jpg isn't an object, is it..(?)

        • 1. Re: imported jpg, how to "crop" or round corners
          Jacob Bugge MVP & Adobe Community Professional

          paperslide,

           

          You may

           

          1) create a rounded rectangle (square), place it, and with the image also selected Object>Clipping Mask>Make.

           

          If you wish to get rid of the outlying parts, you may:

           

          2) In the Transparency palette dropdown select anything but Normal (Multiply is fine),

          3) Object>Flatten Transparency (just keep the default options).

          • 2. Re: imported jpg, how to "crop" or round corners
            paperslide Level 1

            Can I set the radius of the corners to match exactly the area I'd like to keep (or "rid the outlying parts" etc.) ?

            • 3. Re: imported jpg, how to "crop" or round corners
              Jacob Bugge MVP & Adobe Community Professional

              paperslide,

               

              When you create the path to become the Clipping Path, you can set the dimensions including the corner radius by DoubleClicking the Rounded Rectangle Tool.

               

              When you create the Clipping Mask, everything outside the rounded rectangle becomes invisible but is still there.

               

              Through the Transparency and Flatten Transparency procedure, you get rid of everything outside the Bounding Box of the Clipping Path; you are left with an image cut to the Bounding Box and a Clipping Mask.

              • 4. Re: imported jpg, how to "crop" or round corners
                paperslide Level 1

                And if I'd like to make another area within the rounded rectangle transparent/invisible, so that another object I place it over (one with no attribute/appearance) can show through?

                • 6. Re: imported jpg, how to "crop" or round corners
                  paperslide Level 1

                  Does this rounded rectangle that will be the clipping mask have to have a fill, or can it just be a line/border etc. (of the rectangle)? I originally just had the border/line to make adust/setting the radius easier (to see both in and outside of the line).

                   

                  I'm on CS3 and double clicking the rectangle tool does nothing..

                  • 7. Re: imported jpg, how to "crop" or round corners
                    Jacob Bugge MVP & Adobe Community Professional

                    paperslide,

                     

                    Does this rounded rectangle that will be the clipping mask have to have a fill, or can it just be a line/border etc. (of the rectangle)? I originally just had the border/line to make adust/setting the radius easier (to see both in and outside of the line).
                    The Rounded Rectangle or or whichever shape is used may be no fill no stroke or whatever; the same applies to a Compound Path as described by Scott for shapes with holes.

                    I'm on CS3 and double clicking the rectangle tool does nothing..
                    You should be able to select the dimensions after DoubleClicking, or something has changed or is wrong; I presume you mean the Rounded Rectangle Tool (which is in the flyout from the Rectangle Tool).
                    • 8. Re: imported jpg, how to "crop" or round corners
                      paperslide Level 1

                      you wrote:

                       

                      "...When you create the path to become the Clipping Path, you can set the  dimensions including the corner radius by DoubleClicking the Rounded  Rectangle Tool."

                       

                      well, dimensions yes, radius no..

                      • 9. Re: imported jpg, how to "crop" or round corners
                        Wade_Zimmerman Level 6

                        Here is a screen shot of the round corner rectangle tool as opposed to the rectangle tool. If you click on the rectangle tool and hold the mouse down the flyout will appear with the round corner radius and ellipse tool etc.

                         

                        Screen shot 2010-04-21 at 2.01.50 PM.png

                        • 10. Re: imported jpg, how to "crop" or round corners
                          thuth Level 1

                          Great tip!

                           

                          Kinda crappy you have to do a workaround for this. Why wouldn't the RASTERIZE command have an option for NOT including masked contents? I dunno. That is where I would put it.

                           

                          One problem I have noticed with this technique:

                          If you have a masked bitmap like a full window screen grab that you truly want crop to a specific dimension, you actually have to create your mask 2 pixels less tall and less wide, since, (at least for me,) flattening the transparency leaves the image 2 pixels taller and 2 pixels wider inside the mask.

                           

                          Also, I find it helpful to make sure that both your image and mask shape are placed on the whole pixel for X,Y,W,H values for predictable results with antialiasing.

                           

                          I admit I have only tried this twice, but that is my feedback.

                           

                          -Tony

                          • 11. Re: imported jpg, how to "crop" or round corners
                            Wade_Zimmerman Level 6

                            Mostly the problem is that this is not the right way at present to crop an image file it is best to do it in Photoshop either on a transparent layer or with a clipping path or use a clipping mask in Illustrator. A crop tool could be useful but even Adobe gave us such a tool I wonder if it would crop images as well?

                             

                            Of course you have to use the psd format or if you need the compression turn to png which is becoming more and more popular because it supports transparency.

                             

                            Here the image is nice an clean takes a few seconds in photoshop. And I know you want it to be jpeg.

                             

                            Screen shot 2010-04-21 at 2.28.22 PM.png

                            • 12. Re: imported jpg, how to "crop" or round corners
                              thuth Level 1

                              Wade, you are a broken record. All you ever say is that because this is how it is currently done, that makes it the "right" way. Feel free to not respond to my posts because I will never agree with that mentality.

                               

                              If you have some OTHER way to justify something, based in logic or common sense, I am all ears. But the idea that the status quo is somehow always "right" not does hold water with me.

                               

                              I feel if any basic user can see that there is a better way to do something, it is more "right" than the current way. That is not how your head operates, I know. I get that. So just ignore me. I am tired of arguing with you. Many people agree with me.

                               

                              In 2010, IMO you should not require a seperate external image editor just to crop a pasted bitmap in a program that is going on over a dozen releases. This is a common task when assembling artwork. I will of course point out that Freehand has done it flawlessly for something like 15 years. It is especially troubling when AI already has rasterization features in it, which it seems to me is a logical place to give users some control.

                               

                              It is dumbfounding to me that rasterizing a masked image would result in the full dimension of the masked area being converted to white pixels. I can understand for non-square mask shapes (like a circle) that white may need to fill the bounding area of the MASK with white when rasterized. That makes sense to me.

                               

                              Let's say I paste a web page into AI. I want to use the logo in the middle of a business card layout. Luckily the logo is on white on the web page so I have no issues on my white business card layout. So I mask just the tiny area in the upper left with a box and position the logo on the business card. and group the whole thing.

                               

                              I want to mail a quick proof to a client. So I duplicate the card and choose the Rasterize command and choose Screen resolution. Do I just get the card? No. I get a little card on a huge field of white. Can anyone explain why that should be the DEFAULT behavior of the rasterization process?

                               

                              Clearly, it is programatically possible, since the Flatten Transparency workaround gets us 99% there-- it just leaves and extra pixel on all dimensions for some reason. If the user had some control over this setting, that would be great, too.

                               

                              I thought I saw that at least, masked contents won't show in Outline view in AI-CS5 any more which is a step in the right direction.

                               

                              Does anyone know if this rasterization problem is fixed, too?

                              -Tony

                              • 13. Re: imported jpg, how to "crop" or round corners
                                Wade_Zimmerman Level 6

                                Tony dear no one was responding to you. Oh I see i accidentally hit the reply on your message, OMG I always hit the last rely posted it seems easier it was not a reply to your posting it as a reply to the topic.

                                 

                                FYI many users come here and do not actually realize that he proper way handle this task is to do it in Photoshop since it is a raster image editing and creation tool. That is the best way to do this.

                                 

                                As for the actual topic which is how to crop a jpeg to a round cornered rectangle, let us examine that queryto see if we might actually assist the OP.

                                 

                                Jpegs are not ideal to work with except for the web and even at that it is always best to go from a psd or tiff file to the jpeg so do your editing in this case in the psd format in photoshop and import that file and not a jpeg. Jpeg is a lousy compression and you only want to do this if used for the web at the last moment.

                                 

                                You do not really want o import it and then export it again as a jpeg. If using for the press you really don't want to work this format since it can cause really bad results.

                                 

                                It is the way that photos are transmitted but once you receive them hopefully they have only been save and not resaved several time you convert them to tiff or psd and do your editing in photoshop including making rounded corner rectangles out of them.

                                 

                                Then import them into AI for your layout.

                                 

                                Many users, and I am not saying the OP is one of these, are relatively new to design and art creation so they are trained often in the easiest way possible and the field is full of mines that they want to learn before it blows up in their faces.

                                • 14. Re: imported jpg, how to "crop" or round corners
                                  Jacob Bugge MVP & Adobe Community Professional

                                  Tony,

                                   

                                  If you have a masked bitmap like a full window screen grab that you truly want crop to a specific dimension, you actually have to create your mask 2 pixels less tall and less wide, since, (at least for me,) flattening the transparency leaves the image 2 pixels taller and 2 pixels wider inside the mask.
                                  In 10, the Clipping Mask has the right size, but there is an empty overhang on all sides, totalling a bit more than 1pt/px in either dimension, so if you really want to get the right dimensions for further use as a raster image, I think Crop Marks/Crop Area/Artboard is called for.

                                   

                                   

                                  Also, I find it helpful to make sure that both your image and mask shape are placed on the whole pixel for X,Y,W,H values for predictable results with antialiasing.

                                  Agreed.

                                  • 15. Re: imported jpg, how to "crop" or round corners
                                    thuth Level 1

                                    In 10, the Clipping Mask has the right size, but there is an empty overhang on all sides, totalling a bit more than 1pt/px in either dimension, so if you really want to get the right dimensions for further use as a raster image, I think Crop Marks/Crop Area/Artboard is called for.

                                     

                                    Yes, sorry I was not clear about that. The mask is the correct size but the image that is masked is oversized.

                                     

                                    For me, with everything placed on the pixel, the "overhang" was exactly 1 pixel in each direction in AI-CS4-WIN. If you adjust the mask size to account for this, you *can* effectively crop a pasted bitmap. Tediously but successfully.

                                     

                                     

                                     

                                    -Tony

                                    • 16. Re: imported jpg, how to "crop" or round corners
                                      Jacob Bugge MVP & Adobe Community Professional

                                      Tony,

                                       

                                      For me, with everything placed on the pixel, the "overhang" was exactly 1 pixel in each direction in AI-CS4-WIN. If you adjust the mask size to account for this, you *can* effectively crop a pasted bitmap. Tediously but successfully.

                                       

                                      So there is a slight improvement in the successfulness of at least one tedious procedure.