Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8274639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:47:04+00:00 2026-06-08T07:47:04+00:00

I want to repeat a background image that is rotated. Trying to make it

  • 0

I want to repeat a background image that is rotated. Trying to make it seamless is destroying my soul.

Starting with something simple, consider each image is laid out like bricks. Creating a seamless repeating background image is pretty simple:

enter image description here

(the red area is the crop). You can see this working as expected at http://jsfiddle.net/mPqfB.

Now let’s say I want to rotate the image by 45 degrees:

enter image description here

Unfortunately, the same crop no longer works, as you can see on http://jsfiddle.net/mPqfB/1.

I’m trying to figure out how to crop the image correctly so that we have a seamless repeat. There’s probably some fairly trivial maths involved to do this but I can’t for the life of me figure it out.

[Update]

I’m attempting to follow @oezi’s calculations so to make things easier have created an image of dimensions: 100px x 50px.

Therefore:

Least Common Multiple = 100
Hypotenuse = 1002 + 1002 = 20000

Now I’m assuming this means we don’t have to create an image of 20000px x 20000px. Am hoping that @oezi can clarify how he performs his resizing??

If this is a2 + b2 = c2 is equal to c = square root of (a2 + b2)

Then we can concur that our crop should be 141px?

Finally, this doesn’t actually explain where we take the crop from?

[Update 2]

It does look like this is how the resize should be created. Taking a 141px x 141px crop of the image yielded the correct results – http://jsfiddle.net/EfuV2/

As far as where to crop from, it doesn’t actually matter!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T07:47:07+00:00Added an answer on June 8, 2026 at 7:47 am

    is the rotation is exactly 45 degrees, you’ll have to find out the least common multiple of the width and height of your unrotated pattern.

    • in your case, that’s 15100 (width 100 and height 151)
    • it would be much better to scale your pattern to width 100 and height 150, so the least common multiple is only 300

    Take that number and some math (pythagorean theorem). Assume your number is the length of the two short arms and calculate the length of the hypotenuse – that’s our result (make a square image of that size to get your pattern).

    • in your case, that’s 21355
    • with resizing, it’s ~ 424

    Note that this is just typed straight from my head because i can’t try it out practically at the moment – but i’m really sure it’s correct.

    edit: a fast (and messy) test got me to this:

    • https://i.stack.imgur.com/OJ2OR.jpg
    • http://jsfiddle.net/mPqfB/2/ (click the image-link first, otherwise jsfiddle doesn’t show the image)

    accidentally i made the pattern only be 423 in height and the rotation isn’t perfect (don’t have photoshop here), but it’s good enough to prove that my math is correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to load this simple something into my Editor: Write:-repeat,write(hi),nl,fail. So that it
I have a background image that I want to repeat across (repeat-x) however when
I have an image that I want to position in the right and repeat
I want to repeat a background-image for a div vertically till the bottom of
I want to set page background image my css code is- background:url(images/body_bg.jpg) repeat-x top;
I have a header that has a css background image that I want to
I use the CSS Sprite Technique with a background image that looks something like
I want to change my application back ground dynamically.For that background image, i'm saving
I've got a simple question :) Hopefully. So, I wan't to repeat a website-background-image
I have a background image that I want to show after the top header.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.