RSS/Atom feed Twitter
Site is read-only, email is disabled

How to rotate part of an image without getting white triangles at the corners ?

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

Jay Smith
2009-03-31 19:32:08 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

Using Gimp 2.6.6 on Ubuntu 8.04 (Hardy) Linux.

We are testing using Gimp to replace Photoshop on Windoze. However, we are hitting one problem/feature we have not been able to resolve.

We scan images of postage stamps (using xsane from inside gimp). There are multiple postage stamps are on a black background. Some of them are a little crooked and need to be rotated.

We CAN rotate them as desired, but are ending up with unwanted white triangles at the corners.

We have set the background color to black (and tried changing foreground too). Then reselecting and rotating. No difference.

In the preferences on file creation, for background, there are setting choices for white, transparent, foreground color, or background color -- but NOT black (unlike Photoshop). Not sure if this is the problem.

When the image is created, coming in from xsane, there is only one layer.

Method:

- Scanned using xsane from inside gimp: multiple postage stamps on a black background.

- Set background color to black.

- Draw selection around ONE stamp and use rotate tool by dragging the grid around.

Direction = corrective; grid on -- works as desired (but gets white triangles)

Transform (in the rotate tool palette)

- tried Layer (works but gets white triangles)

- tried Selection (just rotates the selection box and not any part of the picture -- that is very odd!!! -- does this not work or do I not understand what it is supposed to do??)

Clipping -- is set to Adjust, but also tried the other settings all of which still end up with white areas.

I understand that I could draw selections around the various unwanted white parts and fill with black, but that is a big pain -- we scan thousands of such images and would thus have to do 4x thousands of fills.

Is Gimp unable to auto-fill those background areas? Or do I not have something setup correctly?

Is the problem related to the way in which we acquire the image in the first place?

What am I missing????

This is automatic in Photoshop (as long as the background is set to black), so I assume that Gimp would do it even better.

Jay

norman
2009-03-31 21:39:30 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

< big snip >

I understand that I could draw selections around the various unwanted white parts and fill with black, but that is a big pain -- we scan thousands of such images and would thus have to do 4x thousands of fills.

Is Gimp unable to auto-fill those background areas? Or do I not have something setup correctly?

Is the problem related to the way in which we acquire the image in the first place?

What am I missing????

This is automatic in Photoshop (as long as the background is set to black), so I assume that Gimp would do it even better.

Just a thought. Suppose you open a new layer, fill it with black and place it below the layer with the stamp.

Norman

Andrew
2009-03-31 22:50:30 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

Jay Smith wrote:

Using Gimp 2.6.6 on Ubuntu 8.04 (Hardy) Linux.

We are testing using Gimp to replace Photoshop on Windoze. However, we are hitting one problem/feature we have not been able to resolve.

We scan images of postage stamps (using xsane from inside gimp). There are multiple postage stamps are on a black background. Some of them are a little crooked and need to be rotated.

We CAN rotate them as desired, but are ending up with unwanted white triangles at the corners.

We have set the background color to black (and tried changing foreground too). Then reselecting and rotating. No difference.

In the preferences on file creation, for background, there are setting choices for white, transparent, foreground color, or background color -- but NOT black (unlike Photoshop). Not sure if this is the problem.

When the image is created, coming in from xsane, there is only one layer.

Method:

- Scanned using xsane from inside gimp: multiple postage stamps on a black background.

- Set background color to black.

- Draw selection around ONE stamp and use rotate tool by dragging the grid around.

Direction = corrective; grid on -- works as desired (but gets white triangles)

Transform (in the rotate tool palette)

- tried Layer (works but gets white triangles)

- tried Selection (just rotates the selection box and not any part of the picture -- that is very odd!!! -- does this not work or do I not understand what it is supposed to do??)

Clipping -- is set to Adjust, but also tried the other settings all of which still end up with white areas.

I understand that I could draw selections around the various unwanted white parts and fill with black, but that is a big pain -- we scan thousands of such images and would thus have to do 4x thousands of fills.

Is Gimp unable to auto-fill those background areas? Or do I not have something setup correctly?

Is the problem related to the way in which we acquire the image in the first place?

What am I missing????

This is automatic in Photoshop (as long as the background is set to black), so I assume that Gimp would do it even better.

Jay

There's probably a better solution to this, but if you add an alpha channel to the image before rotating the selection, then instead of white triangles you'll get transparent sections and you can add a black layer below to fill them in.

A

Jay Smith
2009-04-01 03:48:32 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

Andrew,

Thanks for your suggestion, but...

I must not be understanding something critically important.

I _think_ I did as you described, but after rotation the object I just rotated seems to disappear under the "transparent" (checkerboard) alpha channel, never to be seen again. If I have the black layer underneath, then the rotated object is covered by black.

I have looked at the Help, etc., but it is becoming increasingly obvious that one can't just "drive" this program. It seems you have to be a "master mechanic" just to do relatively simple tasks. Maybe my brain has been poisoned by the "Photoshop way of doing things", but even (what should be) simple things like making the canvas larger (necessary to do if rotating objects that are in a very tight image/canvas) and trying to fill the new area with background color seem to be incomprehensible to me in Gimp -- in Photoshop, you just made the canvas bigger and it was automatically filled by the background color.

Are there any good websites that approach this program from a "here is how to actually do stuff" perspective? I have not found one yet.

I am trying not to be frustrated, but what is soooo simple in my 10-year-old Photoshop is agony (so far) in Gimp. I must really be missing something very, very important!

Jay

On 03/31/2009 04:50 PM, Andrew wrote:

There's probably a better solution to this, but if you add an alpha channel to the image before rotating the selection, then instead of white triangles you'll get transparent sections and you can add a black layer below to fill them in.

A

Jay Smith
2009-04-01 04:11:23 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

Partial Oops...

I had most recently responded to Andrew ...

I _think_ I did as you described, but after rotation the object I just rotated seems to disappear under the "transparent" (checkerboard) alpha channel, never to be seen again. If I have the black layer underneath, then the rotated object is covered by black.

Well... I tried again with a completely newly created image. And it _did_ work as you described.

So I went back to the image I had been messing with and noticed that the one and only layer was labeled by Gimp as "New Layer" instead of "Background". It seems that once you mess with layers and flatten the image, the now-one-and-only-layer is called "New Layer" instead of "Background".

And, IF it is called, by Gimp, "New Layer", the procedure you (Andrew) described does not work (the rotated item turns black).

However, if I flatten, save, and close the file (as .tif -- we are always working with .tif files), and then re-open it, the one-and-only-layer is again called "Background" and the method Andrew described will work.

Thus if one had to do 10 such rotations in a single image (a very typical situation for us), it seems we would have to flatten, save, close, and re-open the file 10 times. That does not seem right.

What am I missing?

Jay

P.S. When I do add the new layer as Andrew describes, it is on top of the original (background) layer and the background layer needs to be moved on top of the new layer so that it can be seen and worked on. My arm is aching from all the mousing around.

David Gowers
2009-04-01 06:07:55 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

Hi Jay,

On Wed, Apr 1, 2009 at 4:02 AM, Jay Smith wrote:

Using Gimp 2.6.6 on Ubuntu 8.04 (Hardy) Linux.

We are testing using Gimp to replace Photoshop on Windoze.  However, we are hitting one problem/feature we have not been able to resolve.

We scan images of postage stamps (using xsane from inside gimp). There are multiple postage stamps are on a black background.  Some of them are a little crooked and need to be rotated.

We CAN rotate them as desired, but are ending up with unwanted white triangles at the corners.

I can confirm this -- except that I always get black, rather than always getting white.
I've just filed a bug report for it. In the meantime, you should be able to work around this by floating the area (select->Float) before rotating. No complex procedures are required, nor any particular redundancy.

This should be pretty easy to fix -- pretty high chances of seeing it in the next 2.6.x release.

BTW, floating before rotating is NOT how I would do this. Instead, I would

1. Make sure BGcolor == black. Expand the canvas slightly using 'resize image' (however much you need, so that the final result is not clipped); 'resize layers' should be set to 'all layers'. 2. Add an alpha channel to the background layer 3. Add a layer filled with black (move it to the bottom -- that is, closest to the bottom of the screen in the layer list. Drag and drop is not necessary, just click on the down arrow under the layers list.) 4. Select stamps and rotate them
5. Save. You will be prompted whether you want to flatten or merge the image contents. Choose 'flatten'.

     - tried Selection (just rotates the selection box and not any        part of the picture -- that is very odd!!! -- does this not        work or do I not understand what it is supposed to do??)

You just described what it's supposed to do -- it transforms the selection. Not the selected pixels, but the actual selection itself. For example, you can make a square selection and rotate it 45 degrees to turn it into a diamond.

The results may be non-obvious if you have 'Show selection outline' turned off :)

Hope this helps!

David

norman
2009-04-01 08:34:06 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

Whilst yo are processing may I suggest that you save as .xcf and only save to .jpg when you have finished.

Norman

Andrew
2009-04-01 08:50:27 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

Jay Smith wrote:

What am I missing?

Maybe a step by step. I've just tried it again and it works with a minimum of mousing (I'm using gimp 2.6.4).

1. Add alpha channel to initial layer. 2. Add new black layer and move it underneath. (After this step make sure you change the active layer to the top one). 3. Draw a rectangle around the crooked stamp. 4. Rotate.
5. Anchor rotated selection.
(Repeat 3-5 as necessary. I haven't tried with more than one 'stamp' but I don't think it makes much difference) 6. Flatten image.
7. Say 'Wow. Gimping is great fun... and easy to do!'

HTH Andrew

David Gowers
2009-04-01 13:59:00 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

Hello,

On Wed, Apr 1, 2009 at 5:20 PM, Andrew wrote:

Jay Smith wrote:

What am I missing?

Maybe a step by step. I've just tried it again and it works with a minimum of mousing (I'm using gimp 2.6.4).

1. Add alpha channel to initial layer. 2. Add new black layer and move it underneath. (After this step make sure you change the active layer to the top one). 3. Draw a rectangle around the crooked stamp. 4. Rotate.
5. Anchor rotated selection.

Thanks, I forgot this

(Repeat 3-5 as necessary. I haven't tried with more than one 'stamp' but I don't think it makes much difference) 6. Flatten image.

This step isn't needed, unless you are saving the same file with several different names/versions and want to avoid being prompted.

David

Jay Smith
2009-04-01 16:28:34 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

Hi David,

If convenient, please advise me of the bug number on this so that I can track it. Thank you very much.

Related to the "bug", I hope you also noted the problem that there is no Preferences option of using "black" as the default for newly created images.

You said...

BTW, floating before rotating is NOT how I would do this.

Please share your reasons why you would not do that. It seems perfectly logical now that I know it is possible, and it seems to be _exactly_ the method/result I wanted without all the other mucking around.

(All the other mucking around [alpha channel, add layer, etc.] may seem simple to Gimpers, but please do it 10,000 times and then tell me how you feel about it -- We have so far scanned & edited over 50,000 such images in Photoshop and have more than double that number yet to go.)

I _really_ appreciate your mention of Select...Float -- that is exactly the needed answer IMHO.

Jay

On 04/01/2009 12:07 AM, David Gowers wrote:

Hi Jay,

I can confirm this -- except that I always get black, rather than always getting white.
I've just filed a bug report for it. In the meantime, you should be able to work around this by floating the area (select->Float) before rotating. No complex procedures are required, nor any particular redundancy.

This should be pretty easy to fix -- pretty high chances of seeing it in the next 2.6.x release.

BTW, floating before rotating is NOT how I would do this. Instead, I would

Hope this helps!

David

David Gowers
2009-04-02 03:03:56 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

Hi Jay,

On Thu, Apr 2, 2009 at 12:58 AM, Jay Smith wrote:

Hi David,

If convenient, please advise me of the bug number on this so that I can track it.  Thank you very much.

http://bugzilla.gnome.org/show_bug.cgi?id=577575

Related to the "bug", I hope you also noted the problem that there is no Preferences option of using "black" as the default for newly created images.

You said...

BTW, floating before rotating is NOT how I would do this.

Please share your reasons why you would not do that.

Because it's far far far far far far slower and more laborious than the method I went on to describe. There is no comparison.

(All the other mucking around [alpha channel, add layer, etc.] may seem simple to Gimpers, but please do it 10,000 times and then tell me how you feel about it -- We have so far scanned & edited over 50,000 such images in Photoshop and have more than double that number yet to go.)

50,000 images? or 50,000 stamps?
The procedure I described would only need to be done once for each image, not for each stamp-rotation. It is far more streamlined, if you typically rotate several stamps out of every single image that you open.

David

Jay Smith
2009-04-02 16:26:07 UTC (almost 16 years ago)

How to rotate part of an image without getting white triangles at the corners ?

David,

Thanks for the bug number.

Regarding the float method, I beg to differ. Unless I am missing something, what we are doing for Floating before rotating is ...

get selection tool (must be done anyway) draw selection (must be done anyway) Ctrl-Shift-L (the only additional work) get rotation tool (must be done anyway) do rotation (must be done anyway) get selection tool (must be done anyway) click to anchor floating selection (must be done anyway)

Just one simple step per rotation. Ctrl-Shift-L. No adding alpha channel
No adding layer
No moving layer to bottom
No flattening layers

You asked about quantity: 50,000 scans, each scan of which contain from one to 20 stamp images, some of which will end up as single-stamp images and others of which will end up as multi-stamp images. So 50,000 of the add-layer method. Probably up to 150,000 (?? maybe more) rotations, but still I think the ctrl-shift-l is a lot faster.

Thanks very much for your help!

Jay

On 04/01/2009 09:03 PM, David Gowers wrote:

Hi Jay,

On Thu, Apr 2, 2009 at 12:58 AM, Jay Smith wrote:

Hi David,

If convenient, please advise me of the bug number on this so that I can track it. Thank you very much.

http://bugzilla.gnome.org/show_bug.cgi?id=577575

Related to the "bug", I hope you also noted the problem that there is no Preferences option of using "black" as the default for newly created images.

You said...

BTW, floating before rotating is NOT how I would do this.

Please share your reasons why you would not do that.

Because it's far far far far far far slower and more laborious than the method I went on to describe. There is no comparison.

(All the other mucking around [alpha channel, add layer, etc.] may seem simple to Gimpers, but please do it 10,000 times and then tell me how you feel about it -- We have so far scanned & edited over 50,000 such images in Photoshop and have more than double that number yet to go.)

50,000 images? or 50,000 stamps?
The procedure I described would only need to be done once for each image, not for each stamp-rotation. It is far more streamlined, if you typically rotate several stamps out of every single image that you open.

David