Saving image quality

This commit is contained in:
Devine Lu Linvega 2017-04-16 14:09:53 -10:00
parent 710b807e89
commit 540452ea39
7 changed files with 43 additions and 38 deletions

View File

@ -7,28 +7,25 @@ Enjoy
## TODOs
General
Splash screen
Hide widget on mouseover
Add locks
Splash screen(Complete)
Merge layers
Export multiple layers file
% Render
balance auto=true ~ auto color
balance 0.8 ~ equal RGB balance
mirror ,100 ~ mirror
Brush
Texture paint
Natural brush(Expand stroke size from stroke lenght)
Color per pointer
Save
$ 1280x800 ~ Export with size
Auto saveAs
History
Undo shortcut
source.save 1280x800 ~ Export with size
> Terminal
Auto Complete
Progress update
Scroll logs
Expand logs
Auto Complete(tab)
? Interrog
Inline Help
* Eye
Swatches, handle all colors
Swatches, handle all colors
- Widget
Clickeable links
- Render
Progress update

View File

@ -20,15 +20,15 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium"
#terminal logs log.input { color:white; }
#terminal logs log.image img { height:85px;width:auto;border-radius: 3px }
#terminal menu { display: inline-block;position: absolute;bottom: 0px;right: 0px;padding: 0px 5px;font-size: 10px;line-height: 20px;color:white }
#terminal.locked input { color:red; }
#terminal.hide { height:25px; }
#terminal.mini { height:120px; }
#terminal.full { height:100vh; }
#widget { position: absolute; top:0px; left:0px; line-height: 20px; font-size:10px; z-index:9000; color:white; width:100%; height:100%; }
#widget span { display:inline-block; line-height:15px; padding:0px 5px; vertical-align: top; }
#widget span { display:inline-block; line-height:15px; padding:0px 5px; vertical-align: top; min-width:100px;}
#widget span name { display: block; border-bottom: 1px solid #333; line-height:25px; margin-bottom:5px;}
#widget .cursor { }
#widget li { display:block; }
#widget li.active { color:#72dec2; }
#widget li.inactive { color:#fff; }

View File

@ -1,5 +1,11 @@
frame.select main ;
frame.select background ;
frame.resize 400x400 ;
brush:color #ff0000 ;
brush.add_pointer 1,1 ;
brush.add_pointer 2,2 ;
brush.add_pointer 2,2 ;
layer.fill #A1A1A1 ;
render.stencil #72dec2 ;
type:size 50 ;
type.write 50,150 "RONIN" ;
type:size 15 ;
type.write 55,180 "VER 0.1 " ;

View File

@ -8,7 +8,7 @@ function Filter_Stencil()
var angle = cmd.angle() ? cmd.angle().degrees : 20;
var color = cmd.color() ? cmd.color().hex : "#ffffff";
ronin.render.layer.clear();
ronin.frame.active_layer.clear();
this.draw(ronin.frame.context(),angle,color);
}

View File

@ -130,21 +130,18 @@ function Cursor(rune)
this.update = function(event)
{
// if(ronin.terminal.module_name){
// this.set_mode(ronin.module);
// }
// else if(event.altKey == true && event.shiftKey == true){
// this.set_mode(ronin.frame.active_layer);
// }
// else if(event.altKey == true){
// this.set_mode(ronin.default);
// }
// else{
// this.set_mode(ronin.brush);
// }
if(event.altKey == true && event.shiftKey == true){
this.set_mode(ronin.frame.active_layer);
}
else if(event.altKey == true){
this.set_mode(ronin.default);
}
else{
this.set_mode(ronin.brush);
}
}
this.set_mode = function(mode)
this.set_mode = function(mode = ronin.brush)
{
if(this.mode == mode){ return; }
this.mode = mode;

View File

@ -2,6 +2,8 @@ function Source(rune)
{
Module.call(this,rune);
this.settings = {"format":"jpg","quality":"1"};
this.add_method(new Method("save",["name","rect","format"]));
this.add_method(new Method("load",["path","position","rect"]),"Add point");
@ -50,21 +52,24 @@ function Source(rune)
ronin.terminal.query("terminal.display mini");
if(this.settings["format"] == "jpg"){
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/jpeg',parseFloat(this.settings["quality"]))+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
}
else{
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/png',parseFloat(this.settings["quality"]))+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
}
/*
if(params.setting("format") && params.setting("format").value == "svg"){
ronin.terminal.log(new Log(this,ronin.path.create_svg(),"image"));
}
else if(params.setting("format") && params.setting("format").value == "jpg"){
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/png')+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
}
else if(params.setting("format") && params.setting("format").value == "rin"){
var w = window.open('about:blank','source');
var html = "";
for (i = 0; i < ronin.terminal.history.length; i++) { html += ronin.terminal.history[i]+";<br />"; }
w.document.write("<title>Source</title><pre>"+html+"</pre>");
}
else{
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/png')+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
}
else
*/
this.layer.remove(this);
}

View File

@ -187,7 +187,7 @@ function Terminal(rune)
}
}
else{
ronin.cursor.set_mode(ronin.brush);
ronin.cursor.set_mode();
}
this.hint(content);