Comments (4)
Hi, it could be caused by lots of things. On linux, check the setting of your PYTHONPATH variable and make sure that your vipsCC area is on there.
from libvips.
Thank you very much for your reply! I come across some problems in my project:crop a 1000*1000 area from a 8000*8000 png image ,than sclae the 1000*1000 area to 8000* 8000 png image,I am not sure wheather the c++ code is right.it takes a lot time.Before using vips ,I had tied many ways,the imagick(PHP,takes 1s) to crop and java to scale(takes 4s) is the beast way I know.C++/Java/PHP code are pasted as accessories.Any good Suggestions?Finally,Forgive my poor English.
Zhongming Wu
Department of Electronics and Information Engineering
Huazhong University of Science and Technology
Wuhan, Hubei, P. R. China
ZIP: 430074
E-mail: [email protected]
At 2012-11-05 23:46:50,"John Cupitt" [email protected] wrote:
Hi, it could be caused by lots of things. On linux, check the setting of your PYTHONPATH variable and make sure that your vipsCC area is on there.
¡ª
Reply to this email directly or view it on GitHub.
from libvips.
Hi again,
In Ruby you could do this:
#!/usr/bin/ruby
require 'rubygems'
require 'vips'
include VIPS
# load the source image
# the :sequential arg means that we will only be accessing this image
# top-to-bottom -- this lets the reader avoid loading the entire image
im = Image.new(ARGV[0], :sequential => true)
# cut out 1000 x 1000 pixels at position 200 x 400
tile = im.extract_area(200, 400, 1000, 1000)
# scale up by a factor of 8 using a bicubic interpolator
big = tile.affinei_resize(:bicubic, 8)
# and save
big.write(ARGV[1])
On my (very old, very slow) desktop PC this runs like this:
$ time ./try83.rb ~/pics/5k.png x.png
real 0m21.433s
user 0m26.362s
sys 0m0.300s
Most of that time is spent in PNG load and save. PNG is a very, very slow file format. If I use tiff instead I see:
$ time ./try83.rb ~/pics/5k.tif x.tif
real 0m4.032s
user 0m6.056s
sys 0m0.588s
Which is more reasonable. This program runs in about 100mb of memory here.
If I try ImageMagick I see:
$ time convert ~/pics/5k.png[1000x1000+200+400] -interpolate bicubic -resize 800% x.png
real 0m36.742s
user 0m37.738s
sys 0m0.864s
So vips is faster than IM at least. The IM program needs about 500mb of memory.
from libvips.
Closing this question, reopen if you need more.
from libvips.
Related Issues (20)
- Conversion to PFM gives incorrect output HOT 2
- Improve `tilecache` performance
- JXL Support in Libvips Web Build HOT 3
- vips: unknown action "dzsave", vips-8.15.1 on Gentoo HOT 1
- Row sums from vips_project do not necessarily give the same value like summing img(i,j) along i HOT 2
- Looks like 8.15.2 tag is wrong? HOT 1
- vips 8.15.2 failed to build with latest xcode HOT 11
- HDR AVIF to HEIC (hdr) HOT 4
- Feature request: Support SDR→HDR via RTX HDR (upmapping / inverse tone mapping)
- AVIF with bitdepth 10 or 12 crashes
- Add nclx->icc colour management to heifload HOT 24
- Segmentation fault when performing very large number of operations HOT 1
- Subsample mode not working with jpegli HOT 4
- Add target write to `rawsave` HOT 2
- Cannot link to proper libraries on Windows 11 Pro. HOT 1
- Thumbnail/Resize removes color on Alpine HOT 1
- Add support for fractional tiff values (eg. 10 or 12 bits per pixel) HOT 6
- Include JXL as Foreign TIFF Compression HOT 3
- The position of "#include <vips/vips8>" matters. HOT 2
- distance transform HOT 1
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 libvips.