-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply a background image to the editor #37
Comments
Until I got this I wasn't really aware that anybody did anything like this but now I am I think it is a great suggestion. I wonder how this would work considering the existing user interface. I guess we would need four new commands - add new background image, resize current background image, decrease opacity, and increase opacity. Is that how you see it? I think it shouldn't be too hard to implement and I might be able to have a go in the next couple of weeks. Perhaps soon we'll need to have two-letter escape commands. |
I wrote some code to do this in branch issue-37. To set a background image you enter ESC-=. It then prompts you for an image URL, which is then displayed in the way you describe. ESC-= then turns it off again. Let me know if it's what you had in mind! |
Thank you, I'll check it out and report back :) |
Good job, works great! Having the image automatically resized to fill the edit window works really well and the dialog box to specify the image URL is ideal. What it would be nice (but not essential) to have would be a way to switch the background image on and off without having to select the image each time, so that it works like a flip book - sometimes I temporarily need to switch off the image that I'm tracing over to see whether what I'm drawing looks any good or not. I've attached a sample image to show the background image functionality. The frame I've loaded was drawn using my original modification so it doesn't match the resized background image. Referring back to my original comments, I don't think the opacity slider and image resize controls are necessary as it would make more sense to crop the image and resize it relative to the frame dimensions first in Photoshop, Gimp, etc. before setting it as the background, and 50% opacity should be about right for most images. |
I've done a few frames where I've traced things like this myself, and I agree, being able to turn on and off this background would be very useful, especially where the background appears for only a subregion of the canvas. How would it best work? We have ESC-= to set the layers, and I guess we'd have another key combination to turn the background on and off? |
Hi @dodginess. I had a think about this. It would actually be pretty easy to set ESC-{ and ESC-} (a little awkward to type and therefore rarely-used) to decrease and increase opacity of the background. I'll have a go at that now. |
Have a go at this and see if it helps. I feel it's a bit clumsy, having to press shift to get to the { and } keys, but the 0.25 steps for opacity seem to work quite well. |
It would be good to have an option to set an image as the background. This would be helpful for anyone wanting to recreate existing frames or trace over the top of a bitmap. I hacked something together quickly by adding a new layer to the HTML code and setting the CSS properties of the layer to z-index:500, opacity:0.5 and pointer-events:none so that it overlays the editor but doesn't capture the mouse clicks meant for the editor. The image would have to be automatically rescaled to suit the size of the editor, but at the moment I'm manually resizing the images I want to trace. Having an opacity slider and a manual resize control (preserving the aspect ratio of the image) would also be useful.
The text was updated successfully, but these errors were encountered: