diff --git a/HISTORY.rst b/HISTORY.rst index 3e887b73be..08f4a7c1f2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,9 @@ =============== - Add view to download a document's OCR text. GitLab #215 - Add user configurable mailer. GitLab #286. +- Use Toasts library for screen messages. +- Reduce verbosity of some debug messages. +- Add new lineart transformation. 2.4 (2017-06-23) ================ diff --git a/docs/releases/2.5.rst b/docs/releases/2.5.rst index 06f7d01956..1b85682407 100644 --- a/docs/releases/2.5.rst +++ b/docs/releases/2.5.rst @@ -24,6 +24,10 @@ Other Changes - Make the task manager translatable. - Add Turkish to the list of processes languages. - Add user configurable mailer support. GitLab issue #286. +- Use Toastr libary for screen messages. +- Reduce verbosity of some debug messages. +- New lineart transformation. Useful to increase the OCR accuracy on some kind + of documents. Removals -------- diff --git a/mayan/apps/converter/classes.py b/mayan/apps/converter/classes.py index 1a5329638d..ab2e5be417 100644 --- a/mayan/apps/converter/classes.py +++ b/mayan/apps/converter/classes.py @@ -324,6 +324,16 @@ class TransformationGaussianBlur(BaseTransformation): return self.image.filter(ImageFilter.GaussianBlur(radius=self.radius)) +class TransformationLineArt(BaseTransformation): + label = _('Line art') + name = 'lineart' + + def execute_on(self, *args, **kwargs): + super(TransformationLineArt, self).execute_on(*args, **kwargs) + + return self.image.convert('L').point(lambda x: 0 if x < 128 else 255, '1') + + class TransformationMirror(BaseTransformation): arguments = () label = _('Mirror') @@ -452,6 +462,7 @@ class TransformationZoom(BaseTransformation): BaseTransformation.register(TransformationCrop) BaseTransformation.register(TransformationFlip) BaseTransformation.register(TransformationGaussianBlur) +BaseTransformation.register(TransformationLineArt) BaseTransformation.register(TransformationMirror) BaseTransformation.register(TransformationResize) BaseTransformation.register(TransformationRotate) @@ -460,3 +471,7 @@ BaseTransformation.register(TransformationRotate180) BaseTransformation.register(TransformationRotate270) BaseTransformation.register(TransformationUnsharpMask) BaseTransformation.register(TransformationZoom) + + + +