PMXBOT Log file Viewer

Help | Karma | Search:

#pil logs for Tuesday the 22nd of July, 2014

(Back to #pil overview) (Back to channel listing) (Animate logs)
[17:51:08] <myusuf3> wiredfool
[17:51:12] <myusuf3> here is what I am getting
[17:51:15] <myusuf3> gist incoming
[17:51:23] <wiredfool> heya myusuf3
[17:51:32] <myusuf3> wiredfool hey! :)
[17:52:52] <myusuf3> wiredfool so here is the code I am using to generate it
[17:53:00] <myusuf3> and the resultant image is in comments
[17:53:01] <myusuf3> https://gist.github.com/myusuf3/578107d9b4facef014cd
[17:55:17] <wiredfool> k. so, jaggies are 2 things. Certainly the alpha//bgcolor issue
[17:55:27] <wiredfool> probably antialias as well
[17:56:28] <wiredfool> fix for the first is to effectively only draw the fonts in alpha by filling the blank image with (fontcolor,0)
[17:56:43] <wiredfool> in your case blank = Image.new('RGBA', base.size, (255,255,255,0))
[17:57:30] <wiredfool> hey wait. Pillow on the iPhone?
[17:57:48] <myusuf3> no this is going to on django server
[17:57:53] <wiredfool> ah
[17:58:34] <myusuf3> is there pillow for iPhone
[17:58:42] <wiredfool> not that I know of
[17:59:30] <myusuf3> because iPhone has image manipulation stuff plus much easier
[17:59:36] <myusuf3> with interface builder etc
[17:59:39] <myusuf3> ok
[17:59:44] <myusuf3> so what were you suggesting?
[18:00:11] <wiredfool> line 6: blank = Image.new('RGBA', base.size, (255,255,255,0))
[18:00:37] <myusuf3> yessir
[18:00:39] <myusuf3> looks greaT!
[18:01:12] <wiredfool> does it look antialiased?
[18:01:27] <myusuf3> refresh gist
[18:02:11] <wiredfool> yep. freetype to the rescue. so much easier than manual antialiasing
[18:02:32] <myusuf3> wiredfool awesome! have you gotten with working on heroku
[18:02:39] <myusuf3> I am not sure it comes with freetype
[18:03:15] <wiredfool> not with pillow. I've just done an IRC bot on heroku
[18:03:43] <wiredfool> also, you're probably going to need a similar but opposite trick for the black text at the bottom
[18:04:18] <myusuf3> shit
[18:04:22] <myusuf3> just noticed text
[18:04:30] <wiredfool> you can draw a black rectangle there
[18:05:20] <myusuf3> know of any tricks to get a quick dimensions for something on page
[18:06:05] <wiredfool> pillow HEAD has a patch for the font stuff so that the bounding box of the text is correct
[18:06:29] <myusuf3> its multiple bounds
[18:06:30] <wiredfool> but it's only off by ascenders, iirc
[18:06:34] <myusuf3> I got dimensions
[18:06:41] <myusuf3> how do i draw a box.
[18:07:13] <wiredfool> http://pillow.readthedocs.org/en/latest/reference/ImageDraw.html#PIL.ImageDraw.PIL.ImageDraw.Draw.rectangle
[18:07:44] <myusuf3> would i draw this on blank image
[18:08:02] <wiredfool> yep
[18:08:48] <wiredfool> the whole point of the bg color is that you're trying to antialias using the alpha channel into the same color, otherwise you'll get a little bleed of the bg color into the outline
[18:09:58] <wiredfool> so if you prefill the background to match the font you're drawing, the outline that you're picking up matches the core of the font.
[18:11:05] <wiredfool> so if you fill everything below ~300px or so black, it should come out right.
[18:11:27] <myusuf3> http://cl.ly/image/3F1X2g2h0G3k/Screen%20Shot%202014-07-22%20at%202.09.12%20PM.png
[18:11:45] <wiredfool> fill with (0,0,0,0)
[18:11:49] <wiredfool> has to be 0 opacity
[18:12:29] <myusuf3> yessir getting the hang of it
[18:12:34] <myusuf3> that worked beautifully
[18:15:03] <wiredfool> cool
[18:17:54] <myusuf3> wiredfool thanks so much for your help
[18:18:03] <myusuf3> that could haven taken much longer than it needed to
[18:18:20] <wiredfool> sure thing. glad to help
[18:30:15] <myusuf3> wiredfool one last thing
[18:30:30] <myusuf3> lets say I wanted to chop up and place the red and green boxes as needed
[18:30:32] <myusuf3> thoughts?
[18:30:43] <myusuf3> so lets say they need to be all green
[18:36:38] <wiredfool> hmmm
[18:37:40] <wiredfool> what I'd do is make a white mask with the borders, and probably the grey line -- 100% opacity there, and 0% elsewhere
[18:37:56] <wiredfool> then programatically make background colors in rects, and apply the mask on top of it
[18:38:44] <myusuf3> wiredfool well I would also need to do arrows
[18:38:51] <myusuf3> i have a picture like this to start with
[18:38:53] <wiredfool> the roundrect corners would probably need to be antialiased, so you'd be doing the same bg color trick as the fonts
[18:39:18] <myusuf3> is there cutting and composition stuff with PIL
[18:39:21] <myusuf3> that would be so much easier
[18:41:11] <myusuf3> wiredfool refresh gist
[18:41:41] <myusuf3> wait
[18:41:47] <myusuf3> I could just have a bunch of base images
[18:41:51] <myusuf3> nvm :)
[18:41:57] <myusuf3> laziness FTW
[18:43:03] <wiredfool> well, you could definitely crop out a red box and a green box and use Image.paste
[18:44:35] <wiredfool> I'd hate to have do all the image combinations manuallt
[22:55:21] <aclark> wiredfool: any thoughts on eric's thoughts? :-)
[22:58:50] <wiredfool> aclark:
[22:58:56] <wiredfool> sorta
[22:59:04] <wiredfool> been meaning to email
[23:00:02] <wiredfool> load in TiffImagePlugin is probably the most complicated
[23:00:17] <wiredfool> not that that is a _good_ thing
[23:00:29] <wiredfool> but it is a thing, and he's got a complicated format.
[23:07:23] <wiredfool> will email him shortly
[23:08:25] <wiredfool> meh. debugging is hard. lets add features
[23:10:43] <aclark> cool thanks
[23:36:37] <travis-ci> [travis-ci] python-pillow/Pillow#1391 (master - 891224e : wiredfool): The build passed.
[23:36:37] <travis-ci> [travis-ci] Change view : https://github.com/python-pillow/Pillow/compare/af4c3c9a8c20...891224e944a2
[23:36:37] <travis-ci> [travis-ci] Build details : http://travis-ci.org/python-pillow/Pillow/builds/30605091
[23:43:06] <travis-ci> [travis-ci] wiredfool/Pillow#420 (master - 891224e : wiredfool): The build passed.
[23:43:06] <travis-ci> [travis-ci] Change view : https://github.com/wiredfool/Pillow/compare/af4c3c9a8c20...55792f892726
[23:43:06] <travis-ci> [travis-ci] Build details : http://travis-ci.org/wiredfool/Pillow/builds/30605699