question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to add a small image into a large image

See original GitHub issue

@jcupitt Hi, I have such python code below and I wanna rewrite it with pyvips. What should I do?

import numpy as np

start_point_x, start_point_y = 500, 500

small_one = np.ones((2048, 2448, 3), np.uint8)
s_h, s_w, s_c = small_one.shape
big_one = np.zeros((10000, 10000, 3), np.uint8)

big_one[start_point_y: start_point_y+s_h, start_point_x: start_point_x+s_w, :] = small_one

print(np.sum(big_one), np.sum(small_one))

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jcupittcommented, Jul 1, 2019

I found a horrible problem in 2.1.6 – some internal tables could grow exponentially in some cases.

I’ve fixed it, and your code should run quickly now. Thanks!

0reactions
NextGuidocommented, Jul 2, 2019

Thanks very much! version 2.1.7 worked!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Enlarge a Photo for Printing Without Losing Quality
Open your image in Photoshop. · Go to the Image Size dialog, check resample, and select "Preserve Details" in the corresponding dropdown menu....
Read more >
How to Resize and Make Images Larger without Losing Quality
Open the file in Photshop, click on “image size, un-check “Resample image”, then start adjusting the pixel size under width until you reach...
Read more >
How to Make Images Larger Without Losing Quality: Real Tests!
Learn to resize and make images larger without losing quality with the best tools for the job. We compare each enlarger with vigorous...
Read more >
How to Resize an Image - All About Images - Research Guides
1. With Photoshop open, go to File > Open and select an image · 2. Go to Image > Image Size · 3....
Read more >
How to Resize Images for Print with Photoshop
To resize an image for print, open the Image Size dialog box (Image > Image Size) and start by turning the Resample option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found