Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
image-compression
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
image-compression
Commits
669a9a33
Project 'Elphel/master' was moved to 'Elphel/image-compression'. Please update any links and bookmarks that may still have the old path.
Commit
669a9a33
authored
Jun 21, 2022
by
Bryce Hepner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests on lwz
parent
98603e37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
6 deletions
+46
-6
FullTester.ipynb
FullTester.ipynb
+46
-6
No files found.
FullTester.ipynb
View file @
669a9a33
...
...
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count":
22
,
"execution_count":
1
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -15,7 +15,7 @@
},
{
"cell_type": "code",
"execution_count":
15
,
"execution_count":
4
,
"metadata": {},
"outputs": [
{
...
...
@@ -23,7 +23,7 @@
"output_type": "stream",
"text": [
"262\n",
"0.39
837348558217806
\n"
"0.39
68581030135283
\n"
]
}
],
...
...
@@ -43,8 +43,8 @@
" else:\n",
" newname = images[i][:-4]\n",
" newnamesforlater.append(newname + \"_Compressed.txt\")\n",
" with open(newname + \"_Compressed.txt\", 'wb') as f:\n",
" f.write(inletters)\n",
"
#
with open(newname + \"_Compressed.txt\", 'wb') as f:\n",
"
#
f.write(inletters)\n",
" file_sizes_new.append((os.path.getsize(newname + \"_Compressed.txt\")))\n",
" file_sizes_old.append((os.path.getsize(images[i])))\n",
"file_sizes_new.append(os.path.getsize(\"first_dic.npy\"))\n",
...
...
@@ -53,7 +53,7 @@
},
{
"cell_type": "code",
"execution_count":
27
,
"execution_count":
5
,
"metadata": {},
"outputs": [
{
...
...
@@ -145,6 +145,46 @@
"print((np.sum(pngsizes) - np.sum(file_sizes_new))/np.sum(pngsizes))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"from PIL import TiffTags\n",
"TiffTags.LIBTIFF_CORE.add(318)\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.6185872808807661\n"
]
}
],
"source": [
"lwz_sizes = []\n",
"for i, filename in enumerate(images):\n",
" newimage = Image.open(filename)\n",
" newimage.save(newnamesforlater[i][:-4]+ \"lzw\" + \".tiff\", compression='tiff_lzw', tiffinfo={317: 2})\n",
"\n",
" lwz_sizes.append(os.path.getsize(newnamesforlater[i][:-4]+ \"lzw\" + \".tiff\"))\n",
"print(np.sum(lwz_sizes)/np.sum(file_sizes_old))"
]
},
{
"cell_type": "code",
"execution_count": null,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment