Jump to content

resize PNG


Kaotic

Recommended Posts

ok I work for an ISP in the Network operations center, we have a projector that displays the Bandwidth for our 3 upstream providers but can only fit 2 on the screen I'm trying to write a script which pulls the PNG graph (which Is generated by some other script) and then crops out all the information around the sides of the graph and shrinks the final image by a set percentage. this way I can fit all 3 graphs on the single screen.

 

here is a sample graph (yes thats a DDoS) I want to get rid of the text at the bottom and sides right up to the values.  don't need the Bits per second part.

 

I know I can do this with GDlib and a basic php script but I cant find a tutorial anywhere for it. any help would be greatly appreciated.

 

graph.png

Link to comment
https://forums.phpfreaks.com/topic/48898-resize-png/
Share on other sites

yep...

 

you will have to utilize the imagecreatefrompng and a few othe functions in the old gd library.

 

havea look at http://uk.php.net/manual/en/function.imagecreatefrompng.php

 

and more generally...

 

http://uk.php.net/manual/en/ref.image.php

Link to comment
https://forums.phpfreaks.com/topic/48898-resize-png/#findComment-241973
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.