gunnar-ifp opened a new pull request #121:
URL: https://github.com/apache/pdfbox/pull/121


   There was a severe performance issue with really big masks if the image 
needs to be scaled to it (i.e. 10000*10000 pixels). Scaling bicubic can take 
6-10 seconds. This patch tries to switch to bilinear resizing for these cases, 
although the threshold might be fine tuned, still.
   
   There was also a double allocation for the final masked image when we can 
simply use the image since applyMask() is always fed with a newly created one. 
Reference hogging and needless allocation have been removed.
   
   Additionally the alpha blending routines were very slow, working on pixels. 
There is now a staggered approach by:
   - direct byte masking which is very fast even for big images (right now does 
now work with padded buffers),
   - exploiting data buffer's sample system to merge the alpha component into 
the ARGB image, letting the sample model do the bit masking,
   - slow pixel expansion to reverse premultiply matte values (but using fixed 
point integer arithmetics).
   
   Additionally also using the interpolation flag of the mask to decide if the 
mask should be interpolated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to