Comments (5)
Works PERFECTLY now with the extra few lines of code!
I found your program specifically for this project, but I'm excited to use it for other projects in the future.
Thanks.
from stitch2d.
How strange. Can you please share your tiles so I can take a closer look?
from stitch2d.
It's quite a large file, so peeled off 4 rows near the top (see zip file). Issue still manifests the same.
Note that the problem row applies to the files starting with "0100_ * * .jpg" which is actually the 101st column since the first column is "0000" not "0001".
Thanks for looking at it. Smaller version of expected final result is picture below.
from stitch2d.
I found the problem. When drawing a mosaic based purely on row/column (i.e., where there is no overlap between tiles and the user doesn't run the align method), the script expects all the tiles to have the same dimensions and places them by multiplying the column index by the tile width and row index by tile height. Since your last column is smaller than the rest, this results in a bad placement.
I'll fix this in the package, but in the meantime you can manually assign tile coordinates as follows:
from stitch2d import StructuredMosaic
mosaic = StructuredMosaic(
"tiles",
dim=4,
origin="upper left",
direction="vertical",
pattern="raster"
)
y = 0
for row in mosaic.grid:
x = 0
for tile in row:
tile.x = x + tile.width
tile.y = y + tile.height
x += tile.width
y += tile.height
mosaic.save("mosaic.jpg")
Note that this approach still expects all tiles in each column to have the same width and all tiles in each row to have the same height (so width/height can vary as long as each column/row is internally consistent).
Please let me know if that solves it for you.
from stitch2d.
Fixed in 09586c6
from stitch2d.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stitch2d.