statestreet Posted January 21, 2014 Posted January 21, 2014 I have an area on a site currently where there's a series of portrait images that appear with a blend mode that was applied in Photoshop. As it stands, anyone adding a new portrait has to have Photoshop, download the source PSD, and export the new file. I don't think we'll need to add new portraits so often that this needs to be automated, but of course, that doesn't stop me from wanting to think about how to do it. What I'd like to do, ideally, is have the server apply the blend mode to the image either when it's uploaded or when it's rendered. I'm guessing I'd have to use GD to do this, and hook into image->size(), but I don't know exactly where I'd start.
adrian Posted January 21, 2014 Posted January 21, 2014 Not sure if you have seen it or not, but this module by horst is currently the PW image manipulation option: http://processwire.com/talk/topic/4264-release-page-image-manipulator/ You may actually need to look beyond GD to imagemagick - it is much more powerful. If you also get the imagick pecl extension, you'll have a very powerful PHP-only tool. I bet you could use horst's module as a starting point to create an imagick version with more options, but you'll have a bit of work ahead of you. If you do want to start tackling this, take a look at my Image Rasterizer module: http://processwire.com/talk/topic/4632-image-rasterizer/ which uses imagick. It should give an idea of how you can manipulate an image on upload using PW and imagick in a simple module. 1
statestreet Posted January 22, 2014 Author Posted January 22, 2014 Wow, that actually looks powerful enough already for what I want to do (IMG_FILTER_COLORIZE will probably do the trick). Thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now