Turning photo into cartoon using PHP - php

Most probably using ImageMagick - how to turn photo into "cartoon"?
Here's what I mean:
(not sure, that step 2 is necessary).
Thanks!

A question asked yesterday shows some ImageMagick approaches to get to step 2.
As for step 3, there is a ImageMagick-based application named G'Mic that provides some advanced multi-step filters. The gallery shows some results that come close. However, it is in C++ so you'll probably need to compile it on your system.
Also, Googling for Imagemagick Cartoonify yields some example scripts that are worth checking out.
Also, make sure you dig into the ImageMagick examples page, one of the greatest IM resources around.
That said, I doubt whether it is possible to build a IM-based solution that works as well as the cartoonifier you show. IM is hugely powerful, but may not have the necessary degree of detailed control, individual programming and vectorization functions. But the basic functionality is possible.

I doubt you can do this using php with some image editing library,
you'll need a graphic editing software like photoshop i am sure there are many tutorials for this thing out there

Related

PHP code explorer - showing classes and functions separately

I wonder if it's possible to view a PHP code source in a way that https://j11y.io/jquery/ shows a JQ code. Of course I mean reading code from a given file, not from websites code.
I'm not looking for programs like the PHPdocumentor.
Thank you in advance for any reasonable reply.
P.S. For perfectionists - I'm searching for a nice website or software (and I would prefer that option, so that I can be quite sure about the security), which will give me such a useful ability. I'm disturbed after using CTRL-F all the time ;)

PHP how to modify image EXIF data

My goal is simple: I'd like to modify the 'Comments' field on an image. This is easy to do manually on any file on Windows (just right click and type in whatever you want).
To do so via PHP does not seem clear at all. There are several drivers out there. I have tried them all and simply could not get them to work. Does anyone have direct experience with one and can provide a concrete example how to do this?
The only thing I got that sort of worked was this http://blog.jacobemerick.com/web-development/manipulating-jpeg-exif-headers/.
However, although I can update some fields it also deletes everything else. I have no experience with EXIF before and from what I can tell he is decodeing the raw image data and interpreting the sections. I simply do not have the knowledge to modify his code for my purposes.
I've tried https://github.com/romainneutron/PHPExiftool but I simply get errors about different classes not being available. I guess this is expected as it's clearly still in development.
I would appreciate any guidance as I'm pretty sure I've read everything the internet has to offer on the topic.
The easiest way is to just use exiftool via imagemagick. This is technically command line, not PHP, though you can use exec (bad) or lean on some of PHP's imagemagick extension. The post you linked to was something I wrote a few years ago and has a few limitations... Only working for certain encoding (Canon, can't remember the specifics) and yes, it does strip out everything and then rebuild. Easier than surgical replacements ;)

PHP form editor?

I was told by my boss to make some plguin for the site, where people can define their own forms. And he was like
There are some free ones, just find one suitible and rework it for the site.
So yeah, ain't found what I was looking for. Are there any? I'd need an open form editor in PHP which allows me to make some changes anywhere. Hope you can help me.
The author here discusses about three open source form generators, may be this could be a starting lead for you:
PHP Form Generator for webmasters – which one is the best? (by Drizad; 8 Mar 2007)
If you know PHP, you might consider the form library Zebra_Form It seems to be one of the leanest, straight forward form frameworks out there. Requirements are basically just PHP & MySQL. There are frameworks like Symfony and Zend that have form libraries, but they are a lot more complicated.

PHP File_PDF Examples / Tutorials?

I've looked through several Google searches now, and continue to keep coming up empty when it comes to finding some end-user documentation for the File_PDF package.
A lot of people have pointed to FPDF, which is a predecessor, and as far I know, no longer compatible. FPDF hasn't been updated (http://fpdf.org/) since 2008, either.
I've found a few small snippets of code for File_PDF here and there, but nothing over like 20 lines of code.
Then I came across this little "nugget" of wealth: http://dev.horde.org/pdf/
There's plenty of examples, none of which I've looked through yet, but I'm hoping it does the trick.
In the mean time, does anyone else have some recommendations for PDF generation with PHP?
Last time I needed to generate PDF files with PHP that is what I used (admittedly back in '07) with no major problems.
Things change though and if File_PDF is more intuitive to use or has a better feature-set then you should obviously use it instead.
I feel obliged to point out that there appears to be a later version of File_PDF available at http://pear.php.net/package/File_PDF than at http://dev.horde.org/pdf/
Have you evaluated any of the PDF related classes at http://www.phpclasses.org?
Ended up using tcpdf, as many examples were provided from their site.

Does a PHP library exist to work with PRC/.mobi files?

I'm writing a WordPress plugin to create an eBook from a selected category in most major eBook formats. I would like to support MobiPocket since that's the format used by the Kindle but I'm not sure how to go about it. From what I've read .mobi files are actually Palm Resource Databases (PRC) but I haven't been able to find a PHP class to work with these.
I thought about using exec along with KindleGen but that would be undesirable as it would complicate initial setup. I've also thought about hosting a web service somewhere and using XML-RPC to accomplish this but that also complicates things.
My question is: is there a PHP class/library (PHP-only preferred) that can work with PRC or even better, a class that specialises in creating MobiPocket ebooks? (needs to be open source since I'm releasing under the GPL)
I've tried searching but haven't been able to find anything.
I don't know whether you're still looking for this PHP library, but just in case: https://github.com/raiju/phpMobi. This is a library that creates mobi files from html files.
It's should still be seen as an experimental version, but it should work without a problem for basic document with a few images.
Unfortunately not; however, the binary compiled format is an open specification available at:
http://www.mobipocket.com/dev/article.asp?BaseFolder=prcgen
The only direct way of transforming the uncompiled format is using the native XML functionality of PHP to create them and then invoking a compiler with exec, which I understand you don't want to do. If you go with this route, the link above also has details about this XML format.
You might want to try the mobiperl tools,
https://dev.mobileread.com/trac/mobiperl/wiki
Please note I haven't tested them yet. But they have been
around since at least 2007 so they should work well by now.
google "Mobiperl - Perl tools for handling MobiPocket files" to
find a thread on mobileread board discussing it. As a new
poster I can't put 2 hyperlinks into my reply.
Another tool I have recently found (but not yet tested), is: http://www.phpclasses.org/package/8173-PHP-Generate-Kindle-ebook-file-in-mobi-format.html#files
It is based upon KindleGen, and looks pretty straight forward to implement.

Categories